preg_grep

(PHP4 )

preg_grep --  Return array entries that match the pattern

Description

array preg_grep (string pattern, array input)

preg_grep() returns the array consisting of the elements of the input array that match the given pattern.

Példa 1. preg_grep() example

  1 
  2 // return all array elements
  3 // containing floating point numbers
  4 $fl_array = preg_grep ("/^(\d+)?\.\d+$/", $array);
  5