<?php
$search=array("<",">","!=","<=",">=");
$value = "name ** vivek ";
function test($item, $key, $arr)
{
static $found;
static $matches;
$str = $arr[0];
$count = $arr[1];
if( strpos($str, $item) !== FALSE ) {
$found++;
$matches .= $item . " ";
}
if ($count == $key + 1){
echo "$found search item(s) found in \"$str\": $matches\n";
}
}
array_walk($search, 'test', array( $value, count($search) ) );
preferences:
54.71 ms | 402 KiB | 5 Q