How could I split a number from end to start?
Considering that the number can have any length.
The closest thing I tried:
$str = "1234"; #or any other number/string ranging from 0 - 99999
#then somehow inverse the number
$arr1 = str_split($str);
if(!empty($arr1[0])){echo "<div ...>".$arr1[0]."</div>";}
if(!empty($arr1[1])){echo "<div ...>".$arr1[1]."</div>";}
if(!empty($arr1[2])){echo "<div ...>".$arr1[2]."</div>";}
if(!empty($arr1[3])){echo "<div ...>".$arr1[3]."</div>";}
if(!empty($arr1[4])){echo "<div ...>".$arr1[4]."</div>";}
Thank you.
Just use strrev function like this:
Update: One liner to do it all: