FW: [PHP] echo "" problem NEW

From: Date: Wed, 09 Jan 2002 06:00:12 +0000
Subject: FW: [PHP] echo "" problem NEW
Groups: php.general 
Request: Send a blank email to php-general+get-79869@lists.php.net to get a copy of this message
Use the \ escape character. echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"639\">\n"; ."<tr>\n"; ."<td>\n"; ."<img src=\"img_heading/spacer.gif\" width=\"25\" height=\"1\" border=\"0\">\n"; ."</td>\n" Use the . to add to echo to make the code easier to manage. Use \n to take a newline in html so that the source code is easy to read once you view it from a browser. Just make sure at the end of your last addition line with . that you end the line with a ; E.g your last line would be ."</table>\n"; That should help you. Andrew Duck -----Original Message----- From: universal2001 [mailto:universal2001@iprimus.com.au] Sent: Wednesday, 9 January 2002 7:01 PM To: php-general@lists.php.net Subject: [PHP] echo "" problem NEW Importance: High Hi again! Thanks for the reply! I still have another question: I want to create a recycleable code by printing a set of html code which I copied and paste from my html edittor. however because there are lots of quotation marks on the html code it result an error page. here is part of the html code: <table border="0" cellpadding="0" cellspacing="0" width="639"> <tr> <td><img src="img_heading/spacer.gif" width="25" height="1" border="0"></td> </tr> <tr> <td colspan="11"><img name="index_r1_c1" src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td> <td><img src="img_heading/spacer.gif" width="1" height="5" border="0"></td> </tr> <tr> <td rowspan="5"><img name="index_r2_c1" src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td> </table> ...etc so I tired to use (echo) like this: echo "<table border="0" cellpadding="0" cellspacing="0" width="639"> <tr> <td><img src="img_heading/spacer.gif" width="25" height="1" border="0"></td> </tr> <tr> <td colspan="11"><img name="index_r1_c1" src="img_heading/index_r1_c1.gif" width="639" height="5" border="0"></td> <td><img src="img_heading/spacer.gif" width="1" height="5" border="0"></td> </tr> <tr> <td rowspan="5"><img name="index_r2_c1" src="img_heading/index_r2_c1.gif" width="25" height="43" border="0"></td> </table>"; but it DOES NOT WORK. How do I get way with all of the quotation marks???? thank for all the help. Dani

« previous php.general (#79869) next »