String match and if statement : String Matches « String « PHP
- PHP
- String
- String Matches
String match and if statement
<?php
$string = "numbers 42";
$pattern = "/[^0-9]$/";
if(preg_match($pattern, $string))
print("Found a match!");
?>
Related examples in the same category