Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

把“男:XXX女:XXXX男:XXX男:XXX女:XXXX”这种形式的字符串转变成数组

我想把“男:XXX女:XXXX男:XXX男:XXX女:XXXX”这种形式的字符串转变成 array(['sex'=>'男','content'=>''XXX],['sex'=>'女','content'=>''XXX],…)这种形式的数组,有什么好的思路么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

正则?/(男|女):[^男女]+/g

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...