# PHP Escape HTML Characters

**URL:** <https://forum.kirupa.com/t/php-escape-html-characters/248885>\
**Category:** programming\
**Created:** [January 12, 2008, 10:09pm UTC](https://forum.kirupa.com/t/php-escape-html-characters/248885 "2008-01-12T22:09:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshchernoff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshchernoff/32/1852_2.png) [@joshchernoff](https://forum.kirupa.com/u/joshchernoff)\
**Post date:** [January 12, 2008, 10:09pm UTC](https://forum.kirupa.com/t/php-escape-html-characters/248885/1 "2008-01-12T22:09:05Z")

</div>

I am playing with the K2 word-press theme and I can’t get the wp\_list\_pages() in word-press to escape it’s html.

here is what I’m trying to do.

```php
<?php htmlentities(wp_list_pages(), ENT_QUOTES); ?>

```

if you look at the page source at [http://gfxcomplex.com/blog](http://gfxcomplex.com/blog) at line 125 you will see that the last var in the flashVar is not escaping the html and the quotes are braking the string.
