Forum Moderators: coopster
$storytext = $story['FIELD1']
$picture2 = $story['FIELD2']
$picture3 = $story['FIELD3'] //where $story['FIELD2'] = hello.jpg
//and $story['FIELD3'] = dog.jpg
---------------------------------------
I then use the code below to replace the FIELD1 text: with
<div class="picture"><img src="/imagescripts/phpThumb.php?src=/images/hello.jpg&w=200"></div>
(where is $picture2)
---------------------------------------
Here's how I attempt it:
function encode($str) {
$str = strip_tags($str);
$str = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<div class=\"picture\"><img src=\"/imagescripts/phpThumb.php?src=/images/".$picture\\1."&w=200\"></div>",$str);
return nl2br($str);} $encode = encode($storytext);
echo $encode;
Can anyone tell me what I'm doing wrong please?
I assume this syntax is wrong
=/images/".$picture\\1."&
function encode($str) {
$str = strip_tags($str);
$str = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<div class=\"picture\"><img src=\"/imagescripts/phpThumb.php?src=/images/".$picture\\1."&w=200\"></div>",$str);
exit($str);
return nl2br($str);}