note 45873 added to language.variables.external

From: Date: Wed, 22 Sep 2004 06:03:07 +0000
Subject: note 45873 added to language.variables.external
Groups: php.notes 
Request: Send a blank email to php-notes+get-77141@lists.php.net to get a copy of this message
I'm going way back in time here, but this is something useful for lots of people new to php. So, replying to steiner277 at charter dot net from two years ago :D This will work: $msg = "The message is:\t" . $_POST['message'] . "\n"; This won't work: $msg = "The message is:\t$_POST['message']\n"; This will work: $msg = "The message is:\t{$_POST['message']}\n"; The superglobal vars are arrays, so like any other array, using them inside double quotes is not the same as using a 'normal' variable. So if you're putting the array var into the double quotes, don't forget your curly braces. :) ---- Manual Page -- http://www.php.net/manual/en/language.variables.external.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45873 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45873&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45873&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#77141) next »