View Single Post
Old 03-19-2008, 08:31 PM   #10 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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:
$vars = array
(
    
'foo' => 'bar',
    
'baz' => 'foo'
);
extract($vars);
var_dump($foo$baz); 
Salathe is offline  
Reply With Quote