I am trying to get a script that makes my predefined keyword converted to links and / or converted to a certain color, size and so on... In one of the other threads Ive posted I got an answer I am a bit curious on, I'll just quote the answer, and hopefully some of you can help me with this.... see my answer below, and help If you want... I'll be forever grateful....
QuoteQuote from: Grayda on Today at 12:26:29 AM
I think I get it. You want certain words to be, say, red. And you want other words to be made in to a link? I think this should help:
Code:
<?php$mytext = "Buffalo with an aqualung";$mytext = str_replace("Buffalo", "<a href='buffalo.php'>Buffalo</a>", $mytext);$mytext = str_replace("aqualung", "<b>aqualung</b>", $mytext);echo $mytext
So when you run the script, Buffalo will be replaced with a link to buffalo.php and aqualung will be made bold.
That, of course, is the simple way to do it. You can get complex with regexes and whatnot, but if you're only doing a few things at a time, this is ideal.
bah.. Im still struggling with this... could anyone be helpful explaining to me how I can use this example in my site? I don't understand a thing, and probably shouldn't be messing with this kind of codes.. lol...
Before my text that needs to be converted I have three other pages included:
<?php include "../url/url.php"; ?>
<?php include "url.php"; ?>
<?php include "url/url.php"; ?>
These makes the top of my pages, and I was hoping that I could set the code in one of those so I don't have to copy&paste the script into every single page...
Don't I need any more script than those few lines?
Im desperate.... lol.... please help...
Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacingAt present my file looks like this 3 Caxxxan Maxxxet Waxxxxe Axxxxxxy Co.Kildare but after the double spacing, I
background color imagefill
HelloI would like to ask you why I see this square in red color just in my local xampp installation. If I run the code in the remote server (http://www.arreglaordenador.com/numberimage2.php) I see the
Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to retrieving and displaying data, but if I click on a valid link in the following code, the content and
date("now") prints out wrong date ?
Hi GuysAnyone know why and how I can fix it ?
FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image per second hence duration of that video gona be 600 sec i.e 10 mins . (frame rate 1per sec) So to do
How to show a complete textarea ??
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 chars wide , using the scroll bar to see beyond 5 lines.After entering notes, I want to echo or print
Gridview Not updating in Update Panel
I have a gridview, three dropdown list boxes, and a button on my form. What is displayed in the gridview depends on the values entered in the dropdown list boxes. The button calls a stored procedure
Need a fuction to count entries in a field
HiI need a fuction to count how many times a email address is entered in to a field.I making a for wordpress that counts how many timesa user has made comments.Thanks
Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:Code: [General]Online=0I would like it to be in a php file as just 0 if possible. Also how would I do this from php file to php file and let
Creating a db with a query
Hello everyone.I'm having troubles creating a db with a query.I'm reading a book called PHP Bibles from Tim Converse I get this errorFatal error: Call to undefined function mysql_create_db() in