Forum Moderators: coopster
My question is, can i somehow let the page know that this page is the city of ORLANDO lets say, and whenever it reads [**CITY**] or something similar in the code (including paragraphs, headings and anywhere else), it automatically replaces the [**CITY**] with the city name, in the case Orlando?
I am not sure if php or anything else can do this, and i dont even know where to begin to search for something like this. Thanks!
[edited by: BlueGhost at 6:27 pm (utc) on Sep. 1, 2006]
Here is how to:
<?
$string = "city of the rising sun";
$word = "city";
$string = preg_replace("/($word) /","orlando ",$string);
echo"$string";
?>
Respect the space where preg_replace() is used or the words will show no space in between.