Jump to content

Replacing the text title with an image?


tomms

Recommended Posts

hey people, happy new years

im kinda new in php and am trying to write a script that will allow me to replace text with a image.

I have a listings page and when a user performs a search i would like any instance of "yes" to be replaced by a checkmark image, and any "no" with a x image.

any help would be greatly appreicated
Link to comment
https://forums.phpfreaks.com/topic/33549-replacing-the-text-title-with-an-image/
Share on other sites

what she's asking is to see the source for the site, we cant tell you more than str_replace() until you show us your source and let us show you how to use it...

for instance if you wanted to get all the contents of google.com and replace every instance of "web" with "cake" (because cake is just as good as the web, dont kid yourself) you would do...

[code=php:0]
<?php
$contents = file_get_contents('http://www.google.com/');

$contents = str_replace('Web', 'Cake', $contents);
?>
[/code]

other than telling you this completely worthless information I would be able to help you incorporate it into your site ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.