我有如下字符串
$data = 1hs: "1 U.S. dollar", rhs: "29.892653 Taiwan dollars"
我想只用空格和双引号分割字符串,这样我就可以得到这样的数组:
$data[ ]= 29.892653 <--- the most important part I would like to get.
$data[ ]= Taiwan dollars <--- not sure is it possible to do this?
到目前为止,我使用下面的代码
$data = preg_split("/[,\s]*[^\w\s]+[\s]*/", $data,0,PREG_SPLIT_NO_EMPTY);
但它只返回 29 并拆分所有标记,包括“。”