HTML escape?
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
HTML escape?
How can I escape some HTML from being processed? It's in a language thing for phpBB3, and I don't want it to be parsed. I tried the one thing that's used in MODX to escape HTML, but it didn't work...help please?
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: HTML escape?
Hi,
You simply replace < and > with < and >. This is also possible in XML (MODX for example), as alternative to CDATA tags. There are some more, & becomes &, " becomes ". This is basically what htmlspecialchars() in PHP does.
For more information take a look at this reference: http://www.w3schools.com/tags/ref_entities.asp
You simply replace < and > with < and >. This is also possible in XML (MODX for example), as alternative to CDATA tags. There are some more, & becomes &, " becomes ". This is basically what htmlspecialchars() in PHP does.
For more information take a look at this reference: http://www.w3schools.com/tags/ref_entities.asp
- we're poor!
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Re: HTML escape?
Last night, before you responded, I tried using htmlescapevars(), and it achieved the same effect. Is this fine to use, or should I manually change the stuff?
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: HTML escape?
- we're poor!
-
- Supporter
- Posts: 316
- Joined: 18 Sep 2007, 14:35
- Real name: David
- Contact:
Re: HTML escape?
haha I'm so stupid...
htmlspecialchars()
...I wasn't looking at the code when I typed that post.
htmlspecialchars()
...I wasn't looking at the code when I typed that post.
That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever
Return to “phpBB Development discussion”
Who is online
Users browsing this forum: No registered users and 26 guests