hi
i have this in text.txt file
putra |aridana | student | traveling
putra |anom| student | coding
made | kartha | working | gaming
my code
$filename = "text.txt";
if(file_exists($filename)) {
$array = file($filename);
//simulating for the passing variable
$text_box=explode(" ",'putra traveling');
$findme=$text_box;
//******
for($j=0;$j<=sizeof($findme);$j++){
foreach($array as $line) {
if(strpos($line, $findme[$j]) !== false) {
$name=$line;
$prima=explode("|",$name);
for($i=0;$i<=sizeof($prima);$i++){
if ($i>=2)
{
echo "<br>";
}
echo $prima[$i];
}
echo "<br>";
}
}
}
}
else {
echo "file does not exist";
}
the result is
putra aridana
student
traveling
putra anom
student
coding
putra aridana
student
traveling
the result is double, how to fix the code so it's show the same result once
thanks