- Created:
- Updated:
- Fairycat
php 使用正则分割字符串
[key] => userBo Object
分成数组
$v = '[key] => userBo Object';
preg_match_all("/([\s]*)([\S]*[\s]*\=\>\s([\S]*)[\s]?([\S]*))/",$v,$va);
$va[0][0] = '[key] => userBo Object';
$va[1][0] = '';
$va[2][0] = '[key] => userBo Object';
$va[3][0] = 'userBo';
$va[4][0] = 'Object';