我想从下面的网址中检索resource_id:
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
我的代码段
$jinput = JFactory::getApplication()->input
$multiple_res = $jinput->getVar('resource_id',array(),'', 'ARRAY');
答案 0 :(得分:3)
你很亲密。试试这个:
$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;
}
享受!
的链接