Friday 15 July 2011

str replace - search for php with str_replace - dont want code rendered -


Can someone help me? I'm trying to change some code at a group of websites at a time, and I did this before. The problem is that I need to replace PHP, and when I see it with str_replace, So, he wants to present the code because of the code looking for a character match, I want to do it:

  $ file_contents = str_replace ("info@ <" echo $ _SERVER [ 'SERVER_NAME'] ?? & gt; "info@mydomain.com", $ file_contents);   

The problem is, give those characters Instead of trying to present that php .. can anybody do this in this situation?

Use single quotes instead of double, and then will be interpreted as a literal string instead of $ _ server ['SERVER_NAME'] You can enter a variable within a single string Excerpt will be required.

  $ file_contents = str_replace ('info @ & lt;? Duplicate $ _SERVER [\' SERVER_NAME \ '] ;? & Gt; ' "Info@mydomain.com", $ file_contents);    

No comments:

Post a Comment