PHP 的真正威力源自于它的函数。在 PHP 中,提供了超过 1000 个内建的函数,其中有一些是功能相反的函数,下面对这些反义词函数进行盘点。
$name = "gouguoyin";
$sex = "男";
$age = "18";
$result = compact("name", "sex", "age");
print_r($result);
输出
[
'name' => 'gouguoyin',
'sex' => '男',
'age' => 18,
]
$data = [
'name' => 'gouguoyin',
'age' => 18,
'sex' => '男',
];
extract($data);
echo "\$name = $name; \$age = $age; \$sex = $sex";
输出
$name = gouguoyin; $age = 18; $sex = 男
$arr = ['I','am','gouguoyin'];
echo implode(" ",$arr);
输出
I am gougoyin
$str = 'I am gougoyin';
print_r(expload($str))
输出
['I','am','gouguoyin']