TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Str _replace Issue (http://www.talkphp.com/absolute-beginners/5807-str-_replace-issue.html)

Tim Dobson 03-05-2011 02:06 PM

Str _replace Issue
 
Hey guys i have been trying to get the hang of the str_replace only have a little issue

i can have
PHP Code:

$thescripttemps str_replace("<wordfilter>","&lt;wordfilter>",$thescripttemps); 

Now that works andit will replace them with no issue, the issue i have is that $thescripttemps contains </wordfilter> and turns it in to &lt;wordfilter aswell which i do not want. Any suggestions? Thanks!

tony 03-05-2011 05:16 PM

I try that with this example
php Code:
echo str_replace("<wordfilter>","&lt;wordfilter>","<wordfilter>hwekljo </wordfilter>");
//returns: &lt;wordfilter>hwekljo </wordfilter>
 
I don't see a problem, maybe with the $thescripttemps?

Tim Dobson 03-05-2011 06:29 PM

Yes you was correct. Lucky you said that because i was on the verge of a give up thanks again. Simple mistakes have such a big impact on these scripts!


All times are GMT. The time now is 03:33 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0