varemenos
3/17/2012 - 3:39 PM

PHP - List Function

PHP - List Function

<?php
	$temp = array('one', 'two', 'three', 'four');
	list($one, $two, $three, $four) = $temp;
	var_dump($temp);
	var_dump($one, $two, $three, $four);

	// RESULTS

	/*

	array($temp)
		0 => string 	'one' 	(length=3)
		1 => string 	'two' 	(length=3)
		2 => string 	'three' (length=5)
		3 => string 	'four' 	(length=4)

	string($one)		'one' 	(length=3)
	string($two)		'two' 	(length=3)
	string($three)		'three' (length=5)
	string($four)		'four' 	(length=4)

	*/
?>