<?php
$strings = array('AbCd1zyZ9', 'foo!#$bar'); foreach ($strings as $testcase) {
echo 'The string ', $testcase, ' consists of all letters or digits.', PHP_EOL;
} else {
echo 'The string ', $testcase, ' don\'t consists of all letters or digits.', PHP_EOL;
}
}
PD9waHAKJHN0cmluZ3MgPSBhcnJheSgnQWJDZDF6eVo5JywgJ2ZvbyEjJGJhcicpOwpmb3JlYWNoICgkc3RyaW5ncyBhcyAkdGVzdGNhc2UpIHsKICAgIGlmIChjdHlwZV9hbG51bSgkdGVzdGNhc2UpKSB7CiAgICAgICAgZWNobyAnVGhlIHN0cmluZyAnLCAkdGVzdGNhc2UsICcgY29uc2lzdHMgb2YgYWxsIGxldHRlcnMgb3IgZGlnaXRzLicsIFBIUF9FT0w7CiAgICB9IGVsc2UgewogICAgICAgIGVjaG8gJ1RoZSBzdHJpbmcgJywgJHRlc3RjYXNlLCAnIGRvblwndCBjb25zaXN0cyBvZiBhbGwgbGV0dGVycyBvciBkaWdpdHMuJywgUEhQX0VPTDsKICAgIH0KfQ==