たとえば、この文字列(干し草の山)のようなPHP文字列があります。
$text = "here is a sample: this text, and this will be exploded. this also | this one too :)";
次に、文字列内で針が発生する順序で PHP 配列を設定したいと思います。だからこれは私の針です:
$needle = array(",",".","|",":");
文字列で針を検索すると、$text
次のように出力されます。
Array (
[0] => :
[1] => ,
[2] => .
[3] => |
[4] => :
)
これはPHPで達成できますか?
これはこの質問に似ていますが、これはJavaScript 用です。