要求:
var str="the emulsion janus
simulate of cu2CO"
想分离成json格式:
str_json={"h1":"the emulsion janus","text1":"simulate of cu","sub":2,"text2":"CO"}
补充:
分隔符只有,,,。
如何用正则表达式分离?或者先计算indexof,然后用普通的字符串分割?
因为要计算大量的,所以要考虑效率。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
试试这个.xml2json