使用$ jinput检索值

I want to retrieve resource_id from the url below:

index.php?option=com_ajax&module=booking_form&method=getBooking&format=json&Itemid=131&date=2016-02-04T00:00:00.000Z&end=1970-01-01T12:00:00.000Z&resource_id=43&resource_id=45&room=41&start=1970-01-01T10:00:00.000Z

My code snippet

$jinput = JFactory::getApplication()->input
$multiple_res = $jinput->getVar('resource_id',array(),'', 'ARRAY');

You were close. try this:

$jinput = JFactory::getApplication()->input;
$multiple_res = $jinput->get('resource_id','','array');

//UNCOMMENT THE FOLLOWING LINE TO PRINT THE ARRAY
//print_r($multiple_res);

//OR LOOP THROUGH THE RESULTS
foreach($multiple_res as $id){
    echo $id;
}

Enjoy!

Here is a link to the JInput Documentation for Joomla