3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isStringOnlyAZ($the_string) { $valid_chars = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); $the_string = str_replace($the_string, "", $the_string); echo $the_string; return (strlen($the_string)==0); } echo isStringOnlyAZ("St mary's"); ?>
Output for 4.3.0 - 7.1.0
1