I have a pretty simple PHP question but I\'m not sure how to do that.
I want to round to the max hundred or thousand depending on the value returned by the database
Here is my 2 cents:
$v = 11; if(strlen($v)<4) { $v = str_pad((int)(substr($v, 0, 1)+1), strlen($v), 0, STR_PAD_RIGHT); } else { $v = substr($v, 0, -4) . str_pad((int)(substr($v, -4, -3)+1), 4, 0, STR_PAD_RIGHT); }