Extracting a key variable from an array within an array :S
Posted: Mon May 07, 2012 12:55 pm
I need the output of this to be:
This is another
This is awesome
Warning: extract() [function.extract]: First argument should be an array in /home/a6972369/public_html/test/index.php on line 10
Would anybody be able to help?
Cheers for your time =]
This is another
This is awesome
<?php $variable_one = array ("one"=>"This is one", "two"=>"This is another"); $variable_two = array ("one"=>"This is two", "two"=>"This is working lol"); $variable_three = array ("one"=>"This is three", "two"=>"This is awesome!"); $user_selection = array ("$variable_one", "$variable_three"); foreach($user_selection as $feed){ extract($feed); echo $two; } ?>I think my thought process is right but I get this error:
Warning: extract() [function.extract]: First argument should be an array in /home/a6972369/public_html/test/index.php on line 10
Would anybody be able to help?
Cheers for your time =]