What was wrong with explode? explode() puts the string into an array. In the sample code below, each word in $myline will be put into an array called $the_words. To read the contents of the array, you can use the foreach() method to print out the contents, or print it out like $the_words[0];
<?
$myline = "number name age sex job
1 jack 24 male unemployee 2 mike 31
male programmer 3 cindy 20 female
cheerleader 23/08/2002";
$the_words = explode(" ", $myline);
?>
Assuming you want the data to print out like this:
number name age sex job
1 jack 24 male unemployee
2 mike 31 male programmer
3 cindy 20 female cheerleader
23/08/2002
you may want to mod the array and put a <BR> after the 5th word. 😉