Hi Happy New Year to you all
Ok here is my problem I hope someone can help me with this.
I am opening a .txt file using
<?php
$filename = "some.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd,filesize ($filename));
fclose ($fd);
$delimiter = "\n";
$splitcontents = explode($delimiter, $contents);
foreach( $splitcontents as $record )
{
preg_match("/(.*)/", $record, $info);
echo '<b><pre>', print_r($info, TRUE), '</b></pre>';
}
?>
my file has sections with lines of information and they go a little like this
RNWS
RNW 05L
RNW 05R
RNW 23L
RNW 23R
ENDRNWS
What I would like to do is get the information between RNWS and ENDRNWS and insert that into an array so all the lines bellow RNWS until I reach ENDRNWS array for each line.
How would I be able to do this any ideas.
thanks in advance and all the best for 2009
Lee