Quick actions

cmd+k|ctrl+k

Navigation

Languages

test_ctype_alnum

Snippet info

Language

Php

Visibility

public

Author

fenghestudio

Created

2020-09-28T05:28:48Z

Updated

2020-09-28T05:28:48Z

<?php

$strings = array('AbCd1zyZ9', 'foo!#$bar');

foreach ($strings as $testcase) {
    if (ctype_alnum($testcase)) {
        echo "The string $testcase consists of all letters or digits.\n";

    } else {
        echo "The string $testcase does not consist of all letters or digits.\n";

    }
}
?>
INFO