Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHPで10年間使用した後も、正規表現でS ***を使用していますが、これを変換するのを手伝っていただけませんか。
$x_ary=split('&x=',$url);
preg_splitと同等ですか?
ありがとうございました
ほとんどの場合、区切り文字を追加する必要があります。
preg_split('/&x=/',$url)
/パターンの一部としてそれらを必要としない場合は問題ありません。また、他の記号はいずれもメタ文字ではないため、エスケープする必要はありません。
/
explode正規表現は必要ないので、あなたの場合は代わりに使用できることに注意してください。
explode