Re: Dumb question
| From: | Bob Irwin | Date: | Thu, 22 Aug 2002 03:35:16 +0000 |
| Subject: | Re: Dumb question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113582@lists.php.net to get a copy of this message | ||
You need to declare $vari as a global variable.
eg;
<?
function getvar()
{
global $vari;
$vari = "bollocks";
}
getvar();
echo $vari;
?>
Best Regards
Bob Irwin
Server Admin & Web Programmer
Planet Netcom
----- Original Message -----
From: "Liam MacKenzie" <phplist@operationenigma.com>
To: <php-general@lists.php.net>
Sent: Thursday, August 22, 2002 1:27 PM
Subject: [PHP] Dumb question
> Hey guys, got a basic question for you...
>
>
>
> <?
> function getvar()
> {
> $vari = "bollocks";
> }
>
> getvar();
> echo $vari;
> ?>
>
>
> How do I make that function return the variable?
>
>
> Thanks,
> Liam
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/