有没有类似的功能stristr()
?我想使用stristr()
,但我不能,因为我的 PHP 版本是 5.2.9。
所以我需要一个类似的功能来提供相同的功能。
<?php
$email = 'USER@EXAMPLE.com';
echo stristr($email, 'e'); // outputs ER@EXAMPLE.com
echo stristr($email, 'e', true); // As of PHP 5.3.0, outputs US
?>
我怎样才能做到这一点?