RE: [PHP] How to convert Function into the variable?
| From: | Chris W. Parker | Date: | Thu, 04 Mar 2004 21:22:52 +0000 |
| Subject: | RE: [PHP] How to convert Function into the variable? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179500@lists.php.net to get a copy of this message | ||
Labunski <mailto:romans@skulme.lv>
on Thursday, March 04, 2004 12:46 PM said:
> Hi, I need to convert the script below into the variable " $content ".
> How to do this?
> I need this because I want to have an output of this function
> anywhere where the $content is.
i think you want the following:
function output() {
$file = file("people.txt");
foreach($file as $value ) {
$output .= "$value<br>";
}
return $output;
}
<?php
$variable = output();
echo $variable;
?>
if this is not what you mean i'm afraid i don't understand your
question.
chris.