hi ancient,
can you show an example of news.txt ?? I don't really understand what the code needs to do.
you want a 2D array? So you should need two loops!?
you need something like this???
PHP Code:
$filename = "news.txt";
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));
$newsTable = explode("|NEWS|", $contents);
$actualNewsTable = array();
for($i = 0; count($newsTable) > $i; $i++)
{
$j = 0;
$str = newsTable[$i];
while ( $str = explode("|~|", $str) )
$actualNewsTable[$i][$j++] = $str;
}
print_r($actualNewsTable);