Welcome Guest, Not a member yet? Register   Sign In
quicker data arrays
#1

[eluser]cwpollock[/eluser]
Is there a quicker way to do this:
Code:
$data = array('users' => $users, 'options' => $options, 'filter' => $filter, 'page' => $page);
#2

[eluser]xwero[/eluser]
what do you mean by quicker?
#3

[eluser]sophistry[/eluser]
you mean "quicker" like this?
Code:
$data = compact('users','options','filter','page');
#4

[eluser]cwpollock[/eluser]
[quote author="sophistry" date="1217877035"]you mean "quicker" like this?
Code:
$data = compact('users','options','filter','page');
[/quote]

compact - perfect.. thanks, just what I was looking for!
#5

[eluser]johnwbaxter[/eluser]
Holy crap, there's a function i'd never heard of, that is sweet. Nice work!
#6

[eluser]xwero[/eluser]
[quote author="audiopleb" date="1217880136"]Holy crap, there's a function i'd never heard of, that is sweet. Nice work![/quote]
I guess there will be more functions you never heard of but are useful nonetheless. You can't remember the all, you have to be rainman to do that Wink
#7

[eluser]johnwbaxter[/eluser]
Generally if i've used it i'll remember it. I know there are lots of functions i don't know about, it all comes with experience though.




Theme © iAndrew 2016 - Forum software by © MyBB