i need some code which can delete/filter arrays which doesn't contain a specific word
or we can say keep only that contain a specific word and drop all other ones
which one use less resource ????
update : the correct answer to my problem is
<?php
$nomatch = preg_grep("/{$keyword}/i",$array,PREG_GREP_INVERT);
?>
Notice the PREG_GREP_INVERT.
That will result in an array ($nomatch) that contains all entries of $array where $keyword IS NOT found.
so you have to remove that invert and use it :) $nomatch = preg_grep("/{$keyword}/i",$array);
now it will get only that lines which have that specific word