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のeregメソッドを変更したい。
私はpreg_match成功せずに使用しようとしました。
preg_match
誰でもこのコードを変更するのを手伝ってくれますか:
if (ereg("/$", $pref) === FALSE) { $pref .= '/'; }
ありがとう
これには、strposを使用できます。
if(strpos($pred, "/") !== false) { echo "true"; }
正規表現とFSM-Mashineが必要ないため、少し高速です。