Re: Dumb question

From: Date: Thu, 22 Aug 2002 04:16:20 +0000
Subject: Re: Dumb question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113588@lists.php.net to get a copy of this message
In article <000901c2498b$ce972950$0e00a8c0@luke>, phplist@operationenigma.com says... > 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 Strangely, by using return. function getvar() { $vari = "bollocks"; return $vari; } $answer = getvar(); echo $answer; ?> -- David Robley Temporary Kiwi! Quod subigo farinam

« previous php.general (#113588) next »