Output variable with HTML formatting intact...

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!

Moderator: General Moderators

Post Reply
HaddyConsulting
Forum Newbie
Posts: 2
Joined: Fri Apr 04, 2008 9:32 am

Output variable with HTML formatting intact...

Post by HaddyConsulting »

How do I output a variable value with HTML formatting intact? I have tried the following without success:

Code: Select all

print "$myvariable";

Code: Select all

printf($myvariable);
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Re: Output variable with HTML formatting intact...

Post by mchaggis »

Both print statements will print the contents of the variable as is, so if it contains html it will be outputted as HTML.

If it is not printing the contents correctly, the the contents is mucked up. Can you post some example outputs as well as your code.
Post Reply