/ Published in: PHP
I want to get only number from user it does not start with zero. I think it's not perfect but works for me.
Expand |
Embed | Plain Text
function check_number($num) { if ( $num[0] == 0 ) { // don't allow 0 start. return false; } return true; } else { return false; } }
Comments
Subscribe to comments
You need to login to post a comment.

function checknumber($num) { if (isnumber($num) & $num != 0) { return true; } else { return false; } }
Yeah, thanks for your advance codes.