Estimated reading time: 0 minutes, 14 seconds
Converting a number from negative to positive is a pretty simple process using the absolute function abs():
$value = abs(-123); // = 123
$value = abs(123); // also = 123
Absolute returns a positive integer or float based. It only returns a positive value, you don't have to worry about what number is going in.