Re: alternatively

From: Date: Mon, 02 Oct 2006 14:19:32 +0000
Subject: Re: alternatively
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-242477@lists.php.net to get a copy of this message
David Tulloh wrote: > Ross wrote: >> How can I get this line to work >> >> $mail_body .= "<font size=\"2\" face=\"Verdana, Arial, Helvetica, >> sans-serif\"> Title: $row['title'] </font>"; >> >> The $row['title'] variable is the problem. > > Drop the quotes when you are inside a quoted string. > $mail_body .= "... Title: $row[title] </font>"; does that actually work? not that I care - I still consider it wrong. there are 2 proper ways to do it: 1. interpolation with curly braces: $x = "...Title: {$row['title']} bla bla"; 2. break out of the string: $x = "...Title: ".$row['title']." bla bla"; as to the religious war over which of the 2 is 'better', grab a gun and pick a side. >

« previous php.general (#242477) next »