You can mix and match single (') and double (")
quotes so the following are all appropriate:

  echo "a 'string' b";
  echo "a \"string\" b";
  
  echo 'a \'string\' b";
  echo 'a "string" b";

See?  PHP can't read your mind and know what " 
goes with what, like:

  echo "a"b"c"d"e"f"g"; // BAD

Now, when dealing with arrays inside strings:

  echo "an {$array['key']} b";
  echo 'an ' . $array['key'] . ' b';
  echo "an $array[key] b";

See also:

  http://www.zend.com/zend/tut/using-strings.php
  http://www.php.net/manual/en/language.types.string.php

Regards,
Philip Olson


On Sat, 28 Sep 2002, Gary wrote:

> Hi All,
> Can someone explain to me why I am getting an error for the following?
> 
> $keywords = $_POST[keywords];
> if ($keywords) {
>     echo"<META NAME="keywords" CONTENT=" $keywords ">";
> }
> 
> TIA
> Gary
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

Reply via email to