Re: Problem with quotes

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

 



On Thu, Feb 21, 2008 at 8:04 PM, Mário Gamito <gamito@xxxxxxxxx> wrote:
> 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
>


Not the problem, but:

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

can be condensed to:

echo "<img src=\"dcs/$key.png\" /> ";

-- 
-Casey

-- 
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