作者在 2016-08-19 15:14:09 发布以下内容
preg_split("/(\".*?\")/is", "good\n$str=\"字符串\";bye", -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
这样分割出来数组是:
=> [
"""
good\n
=
""",
""字符串"",
";bye",
]
然后根据是不是引号"开头,如果是引号开头,则视为字符串