I need to be able to take in an integer and break it down to an array as shown below. However, explode doesn't work on integers, so I am trying to convert the int to a string, but that won't work as well for some reason. Any idea why this is and how to accomplish this?
$num = 321;
$numArr = explode(',',(string)$num);
var_dump($numArr);
Need it to return
array(3) {
[0]=>
string(1) "3"
[1]=>
string(1) "2"
[2]=>
string(1) "1"
}