Hi All, Im trying to split a number down e.g Number passed in: 1234567 This would split down too: Number 1: 1 Number 2: 2 and so on.. Whats the best way to do this? thanks,
$array = str_split("0123456789bcdfghjkmnpqrstvwxyz"); PHP: Will give you an array with each individual char as an element
You can also access a variable as an array without performing any manipulation at all. $number = 1234567; /* $number[0] //1 $number[1] //2 $number[2] //3 $number[3] //4 */ Code (markup):
Hi Both, thanks for your help this has been useful and i have now achieved what i was trying to do Matt