Re: how to return strings from functions?
| From: | David Robley | Date: | Wed, 04 Apr 2001 05:21:01 +0000 |
| Subject: | Re: how to return strings from functions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46977@lists.php.net to get a copy of this message | ||
On Wed, 4 Apr 2001 15:44, Vlad wrote:
> Hi all
>
> script example:
>
> function smth(){
> $result = '1234 - the number';
> return $result;
> }
> ...
> $res = smth();
> ...
> After this $res takes value of 1234 not the actual string.
> Is any soolution here?
>
> Thanks, Vlad
If you do
function smth(){
$result = '1234 - the number';
return $result;
}
$res = smth();
echo $res;
The output is
1234 - the number
What else is in your script?
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA