Hi everyone
I have an extremely annoying problem and was wondering if anyone could shed some light..
I have a regex of the form:
preg_match_all('~<img.*?src=("|\')([^\1]+?)\1~is', $input, $out);
which basically looks for the URL in the image tag. This works fine when I use something like:
$input = "hi there here is an image <img src=\"http://www.bbc.co.uk/blogs/zanelowe/muse-thumb-400x315.jpg\">";
But I'm trying to use it on something like:
$input = $_POST['description'];
where 'description' has an identical img tag to the one in the predefined variable but it's not working. I've tried everything but nothing seems to work..
Is it maybe something to do with escaping quote marks or adding slashes or something?
Any help would be massively appreciated,
Thanks