Making a variable
| From: | Clayton Dukes | Date: | Mon, 26 Feb 2001 16:16:50 +0000 |
| Subject: | Making a variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41694@lists.php.net to get a copy of this message | ||
How can I make this a variable?
ie:
foreach (file("$file.txt") as $line) {
print ("" . trim(str_replace("'", "''", $line)) .
"\n");
}
changed to:
$data = foreach (file("$file.txt") as $line) {
print ("" . trim(str_replace("'", "''", $line)) .
"\n");
}
Simply adding the $data = in front of it doesn't work, I assume it needs to be enclosed by ()
or ; or something right?
Thanks :-)
Clayton Dukes