$text = #כיתוב ריקמה#;
if (preg_match(‘/[p{Hebrew}]/u’, $text)) { return ‘The text is in Hebrew’; } else { return ‘The text is not in Hebrew’; }