I have two dynamic variables
$numberOfX = 2;
and
$numberOfY = 5;
The challenge for me is that I need to divide the number 5(numberOfY
) between 2(numberOfX
). That's an issue cause I will either through a calculation(divide) get a floating number like 2,5 or I can choose (ceil) to round it up but then I get 3(and totally it will be more then 5, namely 6).
I need a whole integers with no decimals. But still it can't be more or less then 5.
So ideally I Would like an array e.g with 3 and 2 in it. As it added will give 5.
How can I do this in PHP , remembering that numberOfX and numberOfY can be any number ?