0
我有一個數組Array ([email] => [email protected] [mobileNo] => 9999999999)
保存數組值到變量PHP
如何
$email = '[email protected]'
$mobileNo = '9999999999'
存儲到變量鍵和值
我有一個數組Array ([email] => [email protected] [mobileNo] => 9999999999)
保存數組值到變量PHP
如何
$email = '[email protected]'
$mobileNo = '9999999999'
存儲到變量鍵和值
只是extract
$input = array('email' => '[email protected]', 'mobileNo' => 9999999999);
extract($input);
var_dump($email, $mobileNo);
輸出嘗試:
string '[email protected]' (length=12)
int 9999999999
['extract()'](http://us2.php.net/manual/en/function.extract.php)確實如此,但考慮你是否真的想要_。將它們作爲數組鍵值時,通常會使更多有組織的代碼假設這些值是相關的。 –