Ninjakreborn Posted September 20, 2006 Share Posted September 20, 2006 Is there a way for me to test something. like if I have an input, I need to make sure it's a number, I can do this withis_number($variable);it will tell me if it's a number, that's easy, but then I have to check to see if it's got the $ symbol in front of it, if it doesn't then I need to put one there, if it does then I need to leave it alone, how can I do this??? Quote Link to comment https://forums.phpfreaks.com/topic/21451-question/ Share on other sites More sharing options...
Ninjakreborn Posted September 20, 2006 Author Share Posted September 20, 2006 actually if I just use if (!is_numeric($variable)) {echo "$variable has to be a number, please go back and correct this";}Won't that guarantee that it's a number, then I can just add the dollar sign on there. Quote Link to comment https://forums.phpfreaks.com/topic/21451-question/#findComment-95639 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.