Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个变量中有这个值(33.8352932,-117.91450359999999)如何将这两个数字分成两个不带括号的变量?
这可以解决问题:
$str = '(33.8352932, -117.91450359999999)'; $pieces = explode(',', str_replace(array('(', ')'), '', $str));
现在,var_dump($pieces)给你这个:
var_dump($pieces)
array(2) { [0]=> string(10) "33.8352932" [1]=> string(20) " -117.91450359999999" }