How do you check if a string contains only digits in PHP

PHP
🤖 Code Explanation
The code is checking if the string only contains digits. If it does, it will print "String contains only digits". If not, it will print "String contains other characters also".

More problems solved in PHP



















