how to read text file and translate fild
===

Hello how to read txt file using php and  replacement with array i want read file like this 

     ||Search||,||s||---||Images||,||i||

this my php code 

    $f = fopen("test.txt", "r");
    $image= "Imgaes";
    	// Read line by line until end of file
    	while (!feof($f)) { 
    
    	// Make an array using comma as delimiter
    	//   $arrM = explode("---",fgets($f)); 
    		$arr = explode("||---||",fgets($f));
    
    	// Write links (get the data in the array)
        $num = 1;
    	 while($num <= 30)
    			{
    			list($eng,$fa) = explode("||,||", $arr[$num]);
    	foreach($html->find('html') as $full){
    	$all = $full->innertext;
    	}
    $fe = str_replace($eng,$fa,$all);
    			$num = $num+1;
    			}
    			echo $fe;}    
    fclose($f);

but this not work:(!!!