Cep Posted April 6, 2006 Share Posted April 6, 2006 I just had a thought but is it possible to declare a value for several variables at the same time?Maybe by doing this,$myVar, $myOther = 1; Quote Link to comment Share on other sites More sharing options...
trq Posted April 6, 2006 Share Posted April 6, 2006 Not in php. Ruby can do this...[code]a,b = 1,2[/code]Cool huh? But yeah... not php. Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 6, 2006 Share Posted April 6, 2006 [!--quoteo(post=362222:date=Apr 6 2006, 09:59 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Apr 6 2006, 09:59 AM) [snapback]362222[/snapback][/div][div class=\'quotemain\'][!--quotec--]Not in php.[/quote]actually, you can assign multiple variables the same value! it looks a little funny in practice, though:[code]// here's the principle$myVar = $myOther = 1;// you can link as many as you'd like. check this out:$one = $two = $three = $four = 1;echo "$one, $two, $three, $four";[/code]have fun with that! Quote Link to comment Share on other sites More sharing options...
Cep Posted April 6, 2006 Author Share Posted April 6, 2006 hehe thanks guys! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.