PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Above code is very simple.... it takes the html and displays it back out to the browser changing the < and > with < etc..
Now i am not that great with regular expressions... im wondering... i have 3 str_replace functions there... is there a more concise way to achive this with less lines of code?
I have it to this the problem is it groups the full html code as a whole with no formating and of course when i add br br in the str_replace it wont do much as htmlentitles is replacing < > etc
hmmm.... mabye i have missed something i think you are reffering to nl2br ?
It doesnt seem to output the html to the browser.
as in this line of code <p> Hello </p> using nl2br outputs just hello ... i am looking for the <p> and </p> to be showing also with hello on the browser.
If I'm after the contents of a page request, I will try to use file_get_contents() after checking to ensure that the url fopen wrappers are turned on. If they are off, I check to see if curl is available and use it, otherwise I attempt to use fsockopen(). If that fails, I bail out throwing an error..