Return to Snippet

Revision: 41524
at February 19, 2011 06:50 by mloberg


Initial Code
<?php
	foreach($array as $key => $value){
		$$key = $value;
	}

	// simple as that

Initial URL


Initial Description
This simply takes an array and coverts it to variables. E.g. If you had an array, $array = array("key" => "value"), after running this script, $key would be "value".

Initial Title
Convert Array To Variables

Initial Tags
php, array, convert

Initial Language
PHP