PHP 8.5.0 Alpha 4 available for testing

Voting

: min(five, seven)?
(Example: nine)

The Note You're Voting On

pressler at hotmail dot de
12 years ago
Note that mb_ereg() does not support the \uFFFF unicode syntax but uses \x{FFFF} instead:

<?PHP

$text
= 'Peter is a boy.'; // english
$text = 'بيتر هو صبي.'; // arabic
//$text = 'פיטר הוא ילד.'; // hebrew

mb_regex_encoding('UTF-8');

if(
mb_ereg('[\x{0600}-\x{06FF}]', $text)) // arabic range
//if(mb_ereg('[\x{0590}-\x{05FF}]', $text)) // hebrew range
{
echo
"Text has some arabic/hebrew characters.";
}
else
{
echo
"Text doesnt have arabic/hebrew characters.";
}

?>

<< Back to user notes page

To Top