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
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 ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.