lundi 29 juin 2015

php tags with regex preg_replace


I have a url let's say : http://ift.tt/1HqMoVf and images tags and here is my regex code for preg_replace: $regex = "-(src\s*=\s*['\"])(((?!'|\"|http://|https://).)*)(['\"])-i"; so if I use this code in the tags above the output will be : but what I want is /example2 and example3 get replaced too but for /example2 it gets only http://ift.tt/gbk8l4 and for example3 it gets http://ift.tt/1GLmpDZ ps : I know how to get domain using parse_url. and f= is src ^^


Aucun commentaire:

Enregistrer un commentaire