Just mostly curious but is there a way to assign one variable to multiple
variables in one single line?
Rather than do this:
$var2 = $var1;
$var3 = $var1;
Is there a method to perform a:
($var2,$var3) = $var1;
--
--Matthew Sims
--http://killermookie.org
--
PHP General Mailing List
From: Matthew Sims [EMAIL PROTECTED]
Just mostly curious but is there a way to assign one variable to multiple
variables in one single line?
$a = $b = $c = $d = 1;
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$var2 = $var3 = $var5 = all the same;
Jason
Matthew Sims [EMAIL PROTECTED] wrote:
Just mostly curious but is there a way to assign one variable to multiple
variables in one single line?
Rather than do this:
$var2 = $var1;
$var3 = $var1;
Is there a method to perform a:
Matthew Sims wrote:
Just mostly curious but is there a way to assign one variable to multiple
variables in one single line?
Rather than do this:
$var2 = $var1;
$var3 = $var1;
Is there a method to perform a:
($var2,$var3) = $var1;
$var1 = $var2 = $var3 = 'some_value';
--
PHP General Mailing List
On Friday 10 September 2004 04:38, Matthew Sims wrote:
Just mostly curious but is there a way to assign one variable to multiple
variables in one single line?
Rather than do this:
$var2 = $var1;
$var3 = $var1;
Is there a method to perform a:
($var2,$var3) = $var1;
manual Expressions
How about:
?
$var1 = $var2 = $var3 = 5;
echo $var1 . 'br/' . $var2 . 'br/' . $var3 . 'br/';
?
Regards,
Justin
-Original Message-
From: Matthew Sims [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 1:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Assigning one var to multiple
How about:
?
$var1 = $var2 = $var3 = 5;
echo $var1 . 'br/' . $var2 . 'br/' . $var3 . 'br/';
?
Regards,
Justin
I had something stuck in my head between what Python does and PHP's list
function. Not sure why I couldn't figure this one out. Thanks all.
--
--Matthew Sims
* Thus wrote Jason Davidson:
$var2 = $var3 = $var5 = all the same;
or
$var2 =
$var3
= $var5
=
all the same;
Curt
--
The above comments may offend you. flame at will.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
8 matches
Mail list logo