Answers for "convert associative array to variables php"

PHP
1

php transform associative array to array

$array = array_values($array);
Posted by: Guest on June-14-2020
0

php define variables from array associative

<?php
	$array = [
		'key1' => 'foo',
  		'key2' => 'bar',
	];
	extract($array);
	
	echo $key1; //print foo
	echo $key2; //print bar
?>
Posted by: Guest on September-07-2020

Code answers related to "convert associative array to variables php"

Browse Popular Code Answers by Language