Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 461 Bytes

str_match.md

File metadata and controls

14 lines (12 loc) · 461 Bytes

str_match()

Determine if a given string matches a given pattern.

str_match($value, $pattern, $case = false)

  • $haystack(string) - the input string.
  • $needles(string) - pattern. Asterisks may be used to indicate wildcards.
  • $case(bool) - match the case.
$string = "What a wonderful world!";
return str_match($string, '*wonder*'); // TRUE
return str_match($string, 'wonder*'); // FALSE
return str_match($string, '*Wonder*', true); // FALSE