this is one of my php script, i want to know how to assign two dimensional arrays in this script as it might help me to solve this small matter to you..plz...kinda need ur help ...
// Fill up array with names
$a[]="home";
$a[]="shop";
$a[]="car";
$a[]="phone";
//get the q parameter from URL
$q=$_GET["q"];
//lookup all hints from array if length of q>0
if (strlen($q) > 0)
{
$hint="";
for($i=0; $i
{
if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
{
if ($hint=="")
{
$hint=$a[$i];
}
else
{
$hint=$hint." , ".$a[$i];
}
}
}
}
// Set output to "Search not found" if no hint were found
// or to the correct values
if ($hint == "")
{
$response="Search not found";
}
else
{
$response=$hint;
}
//output the response
echo $response;
?>
2007-10-27
16:16:17
·
1 answers
·
asked by
lil_girl1280
1
in
Computers & Internet
➔ Programming & Design