且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在PHP中爆炸单个变量

更新时间:2023-12-04 13:35:52

如果您知道要获取的变量数(在本例中为2),则可以直接将它们分配给list :

If you know the number of variables you're expecting to get back (ie. 2 in this case) you can just assign them directly into a list:

list($first, $second) = explode('~', $a);
// $first = 'hello';
// $second = 'world';