grace1004:
The split function is deprecated, so I would use one of the alternatives in the list in the php page:
http://php.net/manual/en/function.split.php
try using print_r to manually check the $data array for any mistakes the split funktion might cause