PDA

View Full Version : Replace all lines except first



Maxchen
03 Apr 2011, 10:31 AM
Hi, I trying do something like that:

$string =
'<img src="1.gif" />
<img src="2.gif" />
<img src="3.gif" />
<img src="4.gif" />
<img src="5.gif" />';
$result = preg_replace('/(<img(.*)>$)/', '.', $string, -1);
echo $result;
I must replace all <img src="..." /> except first line, but with no results...

awniyya1
04 Apr 2011, 03:12 AM
Hello Friend,
Please be clear in what are explaining. What do you really mean by "except first line"?

Ahamed