compact 多个变量转数组
<?php
//多个变量转数组
$name='jb51';
$email='jb51@jb51.net';
$info=compact('name','email');//传递变量名
print_r($info);
/*
Array
(
[name] => jb51
[email] => jb51@jb51.net
)
*/
?>
extract 数组转多个变量
<?php
//数组转多个变量
$capitalcities['England'] = 'London';
$capitalcities['Scotland'] = 'Edinburgh';
$capitalcities['Wales'] = 'Cardiff';
extract($capitalcities);//转变成三个变量 England,Scotland,Wales
print $Wales;//Cardiff
?>