
Originally Posted by
Speeple
$imgSrc = '/images/random.jpeg';
echo preg_replace('#^\s+(\<p class="pfirst"\>)#i', "$1<img src="$imgSrc" style="float: left" />", $body);
Thanks, but I'm having trouble implementing that. I changed your script just a bit to escape some syntax errors, then I inserted it like this:
PHP Code:
echo preg_replace('#^\p class="pfirst"\>)#i', "$1<img src=\"/images/logos/IVR.gif\" style=\"float: right\" />", $body);
echo $text;
}
...where $text displays an article from my database. I also tried it like this:
PHP Code:
echo $text;
echo preg_replace('#^\p class="pfirst"\>)#i', "$1<img src=\"/images/logos/IVR.gif\" style=\"float: right\" />", $body);
}
Then, I placed your script outside the while loop, with the same results.
Thanks.
Bookmarks