Here is a simple function that will round a number up to a given multiple. may this help you
<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function roundUpToMultiple( $number, $multiple) { return ceil( $number/$multiple ) * $multiple; } ?>
Example Usage
<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ echo roundUpToMultiple( 12, 7 ); ?>
0 comments:
Post a Comment