1$nums = ""; //Declare a variable with empty set.
2
3$nums .= $number; //concatenate the empty string with the integer $number You can also use
4
5$nums = $nums.$number; // this and the expression above do the same thing choose whichever you
6 //like.. This concatenation automatically converts integer to string
7$nums[0] is now 4, $nums[1] is now 5, etc..
8$length = strlen($nums); // This is the length of your integer.
9$target = strlen($nums) -1; // target the last digit in the string;
10$last_digit = $nums[$target]; // This is the value of 5. Last digit in the (now string)