How to split a string with php

前端 未结 4 1633
野的像风
野的像风 2021-01-17 20:03

is there any nice way to split an string after \" \" or . ?

Like

$string = \"test.test\" result = test

$string = \"test doe\" result = test
<         


        
4条回答
  •  离开以前
    2021-01-17 20:46

    You could do a strtr of . into space and then explode by space. Since strtr is very fast.

提交回复
热议问题