Reputation: 21
I want to change this code
$reg_exUrl = "/imageshack/";
if(preg_match($reg_exUrl, $imageURL, $url))
so it will check fro more than one site, like
"/imageshack/,/photobucket/";
I'm noob in php!
Upvotes: 2
Views: 5607
Reputation: 6864
In regular expressions, to select an option of multiple choices, use the (|)
snytax:
$reg_exUrl = "/(imageshack|photobucket)/";
if(preg_match($reg_exUrl, $imageURL, $url))
Notice how the /
are only regex delimiters, not part of the matched pattern.
Upvotes: 7