faqts : Computers : Programming : Languages : PHP : Common Problems : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 1 people (100%) answered Yes
Recently 1 of 1 people (100%) answered Yes

Entry

How can I add "preprocessor" to PHP, e.g. replace all "--" with "−" before PHP starts parsing?

Oct 8th, 2006 14:36
Matthew Wilkinson, Sergey Igitov, http://php.net/str-replace


PHP is inherently a preprocessor. If I am correct in thinking, you
merely wish to change all "--" in some HTML code into "−−"
in the HTML as entities. This can be achieved by using str_replace on
the HTML code you wish to process.