Hello,
I am relatively new to PHP and need some help parsing a file.
I was able to use explode to parse the file at the | delimiter , however I cannot figure out how to parse the file at two distinct delimiters.
The file will need to be parsed at the | delimiter and also at the ^ delimiter.
The code below works great, but now I need to expand it to include parsing at ^ delimiter.
<?php
Include "configdatabase.inc";
$filepath = "smp1.txt";
$lines = file($filepath);
$linescount = count($lines);
$data = array();
$i = 0;
foreach ($lines as $val) {
$data[$i] = explode("|", $val);
$i++;
}
?>
Thanks
JBD