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']; 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. Link to comment https://forums.phpfreaks.com/topic/261347-get/#findComment-1339242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.