- Forums
- PHP
- How To Check If A Variable String Is A Number In My Code
this will show you a function you can use to determine and find out if a variable string you have is a numberic [1307], Last Updated: Sat May 18, 2024
sales
Sat May 19, 2012
0 Comments
145 Visits
hi, if you want to know how you can determine if a string numeric or no, you can use the
is_numeric() function
for example:
<?php
$string=14;
if(is_numeric($string)) echo 'is a number;
else echo 'is not a number';
?>
hope that helps