ecabrera Posted April 21, 2012 Share Posted April 21, 2012 How do i make sure when i get a varible from the url that it is only an interger $viewid = $_GET['v']; Quote Link to comment https://forums.phpfreaks.com/topic/261347-get/ Share on other sites More sharing options...
requinix Posted April 21, 2012 Share Posted April 21, 2012 There's typecasting, number functions, string checking, // for example, (int)$_GET['v'] floor($_GET['v']) == ceil($_GET['v']) (float)$_GET['v'] == ($_GET['v'] + 0) ctype_digit($_GET['v']) or regular expressions which you shouldn't use because there's plenty of better options. Quote Link to comment https://forums.phpfreaks.com/topic/261347-get/#findComment-1339242 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.