Re: echo "" problem NEW

From: Date: Wed, 09 Jan 2002 07:00:11 +0000
Subject: Re: echo "" problem NEW
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79872@lists.php.net to get a copy of this message
I simply use single quotes for html and double quotes for PHP. echo "<table border='1' cellpadding='0' cellspacing='0' width='620'>"; works for me. Steve On Tue, 8 Jan 2002, Steven Cayford wrote: > On 2002.01.09 02:00:55 -0600 universal2001 wrote: > > > 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> > > Try to think like a computer program. It sees the command: > echo "<table border=" > followed by a (meaningless to it) 0 and more quoted text, and another 0, > etc... > > The first and last quotes are really part of your command to php, the > others should be treated as harmless text and passed on to the browser as > part of your html. You can tell php to treat quotes as text by escaping > them: putting a \ in front of them like this: > > echo "<table border=\"0\">"; > > Or you could drop out of php mode entirely to do your html like this: > > <?php > ...php stuff here ... > ?> > > <table border="0"> > > <?php > ...more php stuff... > ?> > > One of these methods should get you going. > > -Steve > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > Thank you, Steve Maroney

« previous php.general (#79872) next »