str_replace dynamic problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

str_replace dynamic problem

Post by potato »

Can somebody tell me why this isn't working?
I want to cut the string out of the content.
If i type the $string as a word, not a variabel, it works.
Is there any way to do that?

$content = str_replace($string,'',$content);

many thanks
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

are you sure that $string is set before the str_replace function is called?

what is the error you get?
Post Reply