Regular expressions, complicated but cool
Lets make a string…
1 | $string = "abcdefghijklmnopqrstuvwxyz0123456789"; |
And perform a really simple regular expression (regex) on it:
1 2 | $string = "abcdefghijklmnopqrstuvwxyz0123456789"; echo preg_match("/abc/", $string); |
This will ouput 1 as it has found it, 0 means it does not exist. Infact if this is all you are doing then you may as well use
1 | strpos() |
and
1 | strstr() |
.
And that’s it!
