RE: Problem with quotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Mário Gamito [mailto:gamito@xxxxxxxxx]
> Sent: Thursday, February 21, 2008 11:04 PM
> To: php-general@xxxxxxxxxxxxx
> Subject:  Problem with quotes
> 
> Hi,
> 
> Sorry for such a laim question.
> 
> 
> 
> I have this code:
> 
> $host = 'http://' . $_SERVER['HTTP_HOST'];
> 
> "foreach($browser as $key => $val){
>          echo "<img src=\"dcs/" . $key . '.png"' . " />" . " ";
>          (...) "
> 
> 
> but it has a bug, I need to add the server domain before the picture, so
>   I did:
> 
> $host = 'http://' . $_SERVER['HTTP_HOST'];
> 
> "foreach($browser as $key => $val){
>          echo $host . "<img src=\"dcs/" . $key . '.png"' . " />" . " ";
>          (...)"
> 
> But this way, all it echoes is the $host variable.
> 
> What am I missing here ?
> 
> Any help would be appreciated.
> 
> Warm Regards,
> Mário Gamito

Mmm... It may have to do with operator precedence

Try either:

<code>
	echo ($host . "<img src=\"dcs/" . $key . '.png"' . " />" . " ");
</code>

Or,

<code>
	$output = $host . "<img src=\"dcs/" . $key . '.png"' . " />" . " ";
	echo $output;
</code>

Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: info@xxxxxxxxxxxxx  | MSN Chat: best@xxxxxxxxxxxxx  |  SKYPE: bestplace |
 Web: bestplace.biz  | Web: seo-diy.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux