note 42242 added to language.variables
| From: | raverodNOSPAMatmantrasoftwaredotnet at rn2 dot php dot net | Date: | Sun, 09 May 2004 12:52:12 +0000 |
| Subject: | note 42242 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69373@lists.php.net to get a copy of this message | ||
I'm having the following problem:
In a database, I have the string "Welcome [username]".
In another file, I have the following: "[username],$_SESSION["username"]".
I use the following code (after reading the file as an array into $searchreplace):
foreach ($searchreplace as $line) {
list($search[], $replace[]) = explode(",", $line);
}
How can I have $replace = the value of $_SESSION["username"]?? If I echo both $search and
$replace, the following is outputed:
[username]
$_SESSION["username"]
I need to have $_SESSION["username"] replaced with the actual value of the variable.
----
Manual Page -- http://www.php.net/manual/en/language.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42242
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42242&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42242&report=yes
Search -- http://master.php.net/manage/user-notes.php