說我有一個字符串爆炸串
$what = "1 x Book @ $20 32 x rock music cd @ $400 1 x shipping to india @ $10.5";
我想爆炸,使輸出
Array
(
[0] => 1 x Book @ $20
[1] => 32 x rock music cd @ $400
[2] => 1 x shipping to india @ $10.50
)
我想類似下面,但不知道要使用的正則表達式!
$items = preg_split('/[$????]/', $what);
預先感謝
使preg_split丟棄的分隔符,所以我會去另一個解決方案,如提出Prasanth Bendra。 – 2013-03-27 07:27:53