Check If Variable Is Int Php Code Example


Example: php check if string is integer

<?php $strings = array('1820.20', '10002', 'wsl!12'); foreach ($strings as $testcase) {     if (ctype_digit($testcase)) {         echo "The string $testcase consists of all digits.\n";     } else {         echo "The string $testcase does not consist of all digits.\n";     } } ?>

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?