Mecha CMS

Helper functions.

b

Specify minimum and maximum value for a value, and make sure that the value will not exceed the boundaries.

2.0.0

b($value, [$min = 0, $max = null]);

Example:

$A = b(40);
$B = b(-35);
$C = b(40, [0, 20]);
$D = b(40, [0, 50]);

Result:

$A = 40;
$B = 0;
$C = 20;
$D = 40;