if is present またはif is presentをpreg_replace
置き換える方法はありますか?A
B
A
B
A
B
何かのようなもの:
preg_replace('/ORDER BY field (ASC|DESC)/', 'ORDER BY field (***the alternative not matched***)');
ORDER BY field ASC
anyをに変換しORDER BY field DESC
、 any を に変換ORDER BY field DESC
しORDER BY field ASC
ます。