Web Hosting Talk







View Full Version : Quick PHP help


LJ Host
08-16-2007, 09:19 PM
Hi guys,
I'm needing some help parsing some included html with htmlentities().

So I want it to function something like this:

<? $precode = htmlentities(include('http://someurlwithhtmlcode.php')); ?>

<pre>
<?=$precode?>
</pre>


However the above doesn't work at all.. but you get the idea.

foobic
08-16-2007, 11:32 PM
1. Make sure that short tags are enabled or preferably use full php tags (it's a good habit to get into) <?php ?>
2. Use file_get_contents instead of include
3. You'll need allow_url_fopen enabled

LJ Host
08-17-2007, 02:06 AM
Worked like a charm.. thanks a bunch ;)