It gets the first character from the string $end[$i] , and then accesses the $small array, using that character as the key to the array.
Edit:
Since $foo=200; $foo[0] != 2;//=='' $foo=200; $foo[0] != 2;//=='' , what do you recommend to get the leftmost digit when the value of the number is unknown?
The easiest way is substr($foo, 0, 1) in PHP.
If you use a strongly typed language, I have some indicators that may interest you in reading from my other answer: How can you get the first digit in int (C #)?
John rasch
source share