有什么好方法可以在"或"后分割字符串.?
喜欢
$string = "test.test" result = test
$string = "test doe" result = test
Run Code Online (Sandbox Code Playgroud)
当然我可以使用爆炸两次,但我相信这不是最好的解决方案;)
Pau*_*xon 15
如果你想分成几个不同的字符,请看看preg_split
//split string on space or period:
$split=preg_split('/[ \.]/', $string);
Run Code Online (Sandbox Code Playgroud)