hi it's search again
<html>
<form action="<? echo $PHP_SELF; ?>" method="post">
<input type="text" name="text1" size="40" maxlength="40" value="<? echo $text1?>">
<input type="submit" value="Search">
</form>
</html>
<?
if(!empty($text1)){
$filename = "text.txt";
[B]//the order is lastname|firstname|occupation|hobby|address [/B]
// text.txt content is
// putra |aridana | student | traveling| bali
// anom |mahendra| student | coding, traveling| denpasar
// made | kartha | working | gaming|tabanan
// asti | dewi | student | shoping| surabaya
if(file_exists($filename)) {
$array = file($filename);
$findme=explode(" ",$text1);
$x=0;
foreach($array as $line)
{
$found=false;
for($j=0;$j<sizeof($findme);$j++)
{
if(strpos($line, $findme[$j]) !== false)
{
$found=true;
}
}
if ($found)
{
$prima=explode("|",$line);
echo "<br>";
for($i=0;$i<sizeof($prima);$i++)
{
if($i<=1){
echo "<a href=#>";
echo $prima[$i];
}
else{
echo "</a>";
}
$sort[]=$prima[$i];
}
}
}
}
else {
echo "file does not exist";
}
}
?>
how to sort the result by lastname ?
and when i click the persons name it will show the entire persons data i mean is it possible ? if yes how can i do that ?
(i cut the result only showing the name.)
thanks