The PHP eregi_replace() function can be used to find a string and then replace it with another. They example below could be used to enter your site name where ‘site’ is added.
|
<?php
$site = “Dev Papers.Com”;
$text = “Welcome to site <br> your source for tutorials, articles and just about anything else you can think off!”
$text = eregi_replace( “site”, $site, $text );
Echo $text;
?> |
But, this could become confusing, you may want to have the word site in the text, to fix this we could do the following:
. Remove the I from eregi_replace, this would make it case sensitive.
. Change both sites to sitE
And this would fix the problem.
For more information, visit PHP.net.