I am looking for an efficient way in PHP to split a number in equal parts. The number will always be an integer (without a float).
Let's say that I have an array of $ hours with values from "1" to "24" ($ hours ['1'], etc.) and a variable $ int containing an integer. What I want to achieve evenly distributes the value of $ int in 24 parts, so I can evaluate the value for each corresponding array entry. (If the number is odd, the rest will be added to the last or first values in 24).
Hi,
source
share