|
Posted by Kim Andrι Akerψ on 04/24/06 14:20
wesley@ispace.co.za wrote:
> Can i put a variable inside $_POST. like this:
> $_POST['$var_name'];
> It doesnt work, neither does:
> $_POST[var_name];
>
> thanks Wes
If you have a variable name for a variable to be used with post, like
this:
$var_name = "this_is_text";
Then this:
$_POST[$var_name]
Will be the same as typing this:
$_POST["this_is_text"]
With single quotes, the variable name won't be expanded to its
contents. With double quotes, variables within the string will be
parsed correctly.
http://php.net/language.types.string#language.types.string.parsing
--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Navigation:
[Reply to this message]
|