Jump to content


Photo

Php Check If _Request Array Contains Value

_request

  • Please log in to reply
1 reply to this topic

#1 harvest

harvest

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 22 November 2012 - 06:19 PM

Hi,

I have something like this

<?
if(isset($_REQUEST['groupid'])){
$vesti = Vesti_Manager::getVesti($_SESSION['language_id'],array($_REQUEST['groupid']));
} else {
$vesti = Vesti_Manager::getVesti($_SESSION['language_id']);
}
?>

and i want list only if ['groupid'] is in array (1,2,3,4,5,6,7,8 )

Thanks.

Edited by harvest, 22 November 2012 - 06:20 PM.


#2 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 22 November 2012 - 06:42 PM

Tried in_array ()?
Keeping it simple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com