Answers for "php associative array to variables"

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 "php associative array to variables"

Browse Popular Code Answers by Language