phpSensei Posted August 22, 2007 Share Posted August 22, 2007 This Seemed to work awhile ago but now it just shows up an error: Parse error: syntax error, unexpected ')' in C:\wamp\www\forum_software\index.php on line 68 code: if($_GET['forum'] != (int) ){ die(page_error()); } I want to check if the "forum" variable that was passed from the URL is an interger or not... Link to comment https://forums.phpfreaks.com/topic/66200-solved-string-types/ Share on other sites More sharing options...
Barand Posted August 22, 2007 Share Posted August 22, 2007 The syntax (int) is used to cast a variable as int. try if (!is_numeric($_GET['forum'])) Link to comment https://forums.phpfreaks.com/topic/66200-solved-string-types/#findComment-331143 Share on other sites More sharing options...
phpSensei Posted August 22, 2007 Author Share Posted August 22, 2007 thanks, topic solved. Link to comment https://forums.phpfreaks.com/topic/66200-solved-string-types/#findComment-331231 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.