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

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer