2
I have the following code:
<?php
$content = '
text text text text <img src="path/to/image/1">text text text text
<img src="path/to/image/2">
text text text text text text text text text text text text text text text text <img src="path/to/image/3"><img src$
<img src="path/to/image/5"> ';
$frst_image = preg_match_all( '|<img.*?src=[\'"](.*?)[\'"].*?>|i', $content, $matches );
print_r($matches[0]);
He is returning:
Array
(
[0] => <img src="path/to/image/1">
[1] => <img src="path/to/image/2">
[2] => <img src="path/to/image/3">
[3] => <img src="path/to/image/4">
[4] => <img src="path/to/image/5">
)
However, I want you to return only the content contained within src, how do I do that?
http://stackoverflow.com/questions/887307/getting-href-value-of-from-a-tag
– durtto
I need it done in the back-end
– Fábio Jânio