another question from me ;-). I want to use the explode function to separate a text file that I read into a string, into an array. So, looking at the little example text file right below:
Bubba, Comps, 12/23/1984 Ahmed, Allthat, 04/12/1979
If i take the above text file and run the following code on it
$filename = "data.txt";
$fp = fopen($filename, "r" ) or die("Could not open file");
$contents = file_get_contents($filename);
fclose($file);
$delimiter = ",";
$splitcontents = explode($delimiter, $contents);
$counter = "";
print $splitcontents[2];
So, once I get to splitcontents[2] i get the following printout
12/23/1984 Ahmed
I want the birthdate and the name separate. My question is, can I include an additional delimiter, or how do I get it working so all first names, last names, and birth dates are in separate array slots. Thanks again for all the help and advice.

New Topic/Question
Reply



MultiQuote





|