PHP ver gevorderde |
|
Daar zit je fout:
$searchterms = explode(" ",$_POST['q']);
$count = countQUERY(array($arr['Name'],$arr['Forword'],$arr['Tut'],$arr['Keywords'],$arr['Description']),$searchterms);
$searchterms = explode(" ",$_POST['q']); $count = countQUERY (array($arr['Name'],$arr['Forword'],$arr['Tut'],$arr['Keywords'],$arr['Description']),$searchterms);
$searchterms = Array
function countQUERY($Array,$Search)
{
$count = 0;
if(arrayinstr($Array, $Search))
{
function countQUERY($Array,$Search) { $count = 0; if(arrayinstr($Array, $Search)) {
$Search = Array
function arrayinstr($array, $string)
{
foreach ($array as $arraypiece)
{
if(!preg_match("/".$arraypiece."/i", $string))
return false;
}
return true;
}
function arrayinstr($array, $string) { foreach ($array as $arraypiece) { return false; } return true; }
$string = Array
Jij doet dit:
preg_match(string, array)
en dit is correct:
preg_match(string, string) |