picture in link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Infinity
Forum Commoner
Posts: 44
Joined: Mon Feb 02, 2004 12:48 pm

picture in link

Post by Infinity »

in a link i need to replace the text with a picture but i cant seem to get the format correct

Code: Select all

<?php
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'><a href="$row[dllink]">picture here</a></div></td></tr>";
?>
I need to replace picture here with the picture or icon in this case i.e.
./templates/fisubsilversh/images/icon_download.gif
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Code: Select all

<?php
$search = "picture here";
$replace = "<img src='./templates/fisubsilversh/images/icon_download.gif' />";
$subject = "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'><a href="$row[dllink]">picture here</a></div></td></tr>";
$doreplace = str_replace($search, $replace, $subject);
?>
Infinity
Forum Commoner
Posts: 44
Joined: Mon Feb 02, 2004 12:48 pm

Post by Infinity »

Thanks duff
Post Reply