- preg_match: documentation ( source)
<?php
$text = 'ahmed.'; // arabic
//$text = 'פיטר הוא ילד.'; // hebrew
if (preg_match('~\p{Arabic}~u', $text))
echo "Text has some arabic/hebrew characters.";
else
echo "Text doesnt have arabic/hebrew characters.";
?>