|
preg_grep
Return array entries that match the pattern
(PHP 4, PHP 5)
Example 1715. preg_grep() example<?php Code Examples / Notes » preg_grepmoe
<?php /* count non-empty strings in array */ function count_filled($a=array()){ return count($c=preg_grep("%[\S]%",$a)); } ?> |