Jump to content

Relevant Arrays For Str_replace Cannot Be In Inc File?


son

Recommended Posts

I have a str_replace function, which I need to use on each individual web page and there for several fields, which are displayed from database. My issue is that I would like to have:$issues = array("£", "€");$replacements = array("£", "ß");in an include file, so I can maintain it from one place. This does not work, problematic characters do not get replaced. Only when I have:$issues = array("£", "€");$replacements = array("£", "ß");$text = str_replace($issues, $replacements, $text);all in relevant web page the problematic characters are replaced. Is there another workaround? This is not very efficient...Son

Link to comment
Share on other sites

Can you show an example? If you have the find and replacement arrays defined you only need the str_replace line in your other files to tell it what to work on.
It started working (which it should have in the first place). Sometimes I cannot quite understand why some things do not work in first place, but then without a change from my part they start to work. Maybe when I upload changes there is still some stuff cached. It is a miracle to me...Thanks for your help,Son
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...