> ----- Original Message ----- 
> From: "Victor" <[EMAIL PROTECTED]>
> To: "'Rick Emery'" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 10, 2002 1:49 PM
> Subject: RE: [PHP] Re: Help please: Unable to get 
> $_POST["variable"]; to work in a form.
> 
> 
> Why are you using $_POST[""]? I thought you had to use $_POST['']. I
> always use '' instead of "" and it always works. Is it just 
> me? Can one
> really use double quotes? 

Of course you can -- it's just a string!  The difference, as with all
strings, is in whether you want variable names to be interpolated or not.
Consider:

   $num = 3;
   $array = array('var 3'=>'Interpolated!', 'var $nuum'=>'Not
Interpolated');
   echo $array['var $num'];    // => Not Interpolated
   echo $array["var $num"];    // => Interpolated!
   echo $array['var '.$num];   // => Interpolated!

Of course, an arrray subscript can be any expression, so to go to extremes I
could even do something like:

   $x = 1;
   $y = 2;
   $a = 'a';

   echo $array['v'.$a."r ".($x+$y)];   // => Interpolated!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

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

Reply via email to