PHP breakup Arrary In Variables?

  • Thread starter Thread starter DANIEL C
  • Start date Start date
D

DANIEL C

Guest
What I need to do is break up an array like

$var = array('foo', 'bar');

and have the array values turned into variables without my having to individually name them.. so like I would add another value to the array and another variable would be made... like.

$foo & $bar

thanks!
 
You can use the php build in function extract.

int extract ( array var_array [, int extract_type [, string prefix]] )

It takes an associative array var_array and treats keys as variable names and values as variable values
 
Back
Top