php - getting N number in a number -
i have array , getting length using sizeof()
. in size of array want how many 10 there in number. used %
in getting number like:
$arraysize = 13;//sizeof($array) $numberoften = $arraysize % 10 // getting 3
from here know wrong. want 2. because want every 10. if length 9 want 1. if length 31 want 4.
what correct function of way desired output?
what you're after ceil()
returns next highest integer value rounding value if necessary.
$numberoften = ceil($arraysize / 10);
there's floor()
if want round number down nearest integer. seem fit better question...
i want how many 10 there in number
Comments
Post a Comment