One of our pages pulls content from a database table using the following code:
<?php echo $project['description']; ?>
What I need is for all < and > instances to be replaced with < and > respectively. Can you help modify the above code to include a preg_replace statement (or str_replace())?
Should get you what you need.
If you are ONLY looking to decode those, though, then:
And preg_replace should look like this:
I’m pretty sure the
&isn’t a special character, but if it does cause you issues, put a\before it.