Re: returning value to variable

From: Date: Sat, 14 Feb 2004 16:50:32 +0000
Subject: Re: returning value to variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-177705@lists.php.net to get a copy of this message
tg wrote:
hi i need returning value of function as a variable example : function 1 () {
    return "some error";
} function 2 () {
    $v = 1();
    if ( $v != '' ) echo "error";
} it doesn't work this way
Are you using 1 and 2 as the function names in your real application? Hope not, because function names same as variable names in all languges can not begine with digit. Your 1 and 2 functions not work in my computer either, but they start to work after I have changed 1 and 2 to a and b respectively. Best Bao
this works : echo 1(); but i need the string value as a variable thanks


« previous php.general (#177705) next »