You can do it this way if you need a variable length of number.
It returns variables a0=1 a1=9 a2=9 a3=4;
or you could just access the numbers like a string as the code below does.
Halfabee
$number="1984";
for( $i=0;$i<strlen($number);$i++ ) {
${'a'.$i} =$number{$i};
}
// or do it manually
$thousands = $number{0};
$hundreds = $number{1};
$tens = $numbers{2};
$units = $numbers{3};
// or mathematically
$thousands = floor($number/1000};
$hundreds = floor($number/100};
$tens = floor($number/10};
$units = $number%10;