note 42242 rejected from language.variables by cece
| From: | cece@php.net | Date: | Sun, 09 May 2004 12:56:13 +0000 |
| Subject: | note 42242 rejected from language.variables by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69374@lists.php.net to get a copy of this message | ||
Note Submitter: raverod NOSPAM at mantrasoftware dot net
----
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.