PHP Echo & HTML Code
Posted: Sat Jun 20, 2009 10:02 pm
Simple question, how can I circumvent having to place slashes in front of quotation marks to get PHP to echo HTML code correctly?
For instance, let's say I have this.
echo "<table border=\"0\">";
I recall seeing somebody circumvent this problem with something similar to the below.
<?
echo "
:>
<table border="0">
<:
";
?>
I don't recall the specifics of what exactly was placed where the ":>" and "<:" are. I know I can simple omit using quotation marks and the code would display just fine, however, this is not an acceptable solution for me. Any help would be greatly appreciated.
Thanks.
For instance, let's say I have this.
echo "<table border=\"0\">";
I recall seeing somebody circumvent this problem with something similar to the below.
<?
echo "
:>
<table border="0">
<:
";
?>
I don't recall the specifics of what exactly was placed where the ":>" and "<:" are. I know I can simple omit using quotation marks and the code would display just fine, however, this is not an acceptable solution for me. Any help would be greatly appreciated.
Thanks.