Split integer into individual numbers?

Hey,

Just a (hopefully) quick question.

I have a number, which is probably two or three digits long. How would I split this integer into an array, with each singular digit as a part of the array, without anything to explode it by?


$number = 25;
// $number[0] = 2;
// $number[1] = 5;
// etc...


I’ve searched quite a bit, but I can’t find anything! Any help would be much appreciated.


<?php

header('content-type: text/plain');

# PHP5
print_r(str_split(25));

# PHP4
$d = 25;
$r = array();

for ($i = 0; $i < strlen($d); $i++) {
    $r[] = substr($d, $i, 1);
}

print_r($r);

Thank you very much for the response, it looks perfect.