![]() |
Assigning variables on one line
How would I do a multiple variable assigning?
example PHP Code:
|
I'm not entirely sure myself...
I can't really see why you wouldnt just want to.. PHP Code:
|
Quote:
|
I figured out a way for it to work:
PHP Code:
|
Quote:
;p |
Quote:
PHP Code:
|
|
Quote:
|
Quote:
PHP Code:
|
If you were going to use an associative array, then
extract() would be better than the foreach loop. Though, I'm still struggling to see the purpose here. Why not just assign the values 'normally'... keep it simple.Extract PHP Code:
|
Quote:
|
Mmmm, can I know in which use case you need to do that ??
|
The speed boost gained by less line of code is insignificant as best, readability of your code also goes down loads - it looks nice and obfuscated but keep it simple.
|
| All times are GMT. The time now is 11:56 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0