// $url = "http://www.baidu.com/";
$url= "https://www.icourse163.org/web/j/courseBean.getCoursePanelListByFrontCategory.rpc?csrfKey=8259facdbcf54eebbb98ee0b438c10b2";
$UserAgent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36';
// $data=array('type'=>0,'orderBy'=>0,'pageIndex'=>1,'pageSize'=>20,'categoryId'=>'1001043131');
$data=array('type'=>0,'orderBy'=>0,'pageIndex'=>1,'pageSize'=>20);
// $headers = array("Content-Type: multipart/form-data", "Content-Length: 62","edu-script-token: 8259facdbcf54eebbb98ee0b438c10b2");
// $headers = array("Content-Type: multipart/form-data", "Content-Length: 62");
$referer ='https://www.icourse163.org/category/computer';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_COOKIE, 'EDUWEBDEVICE=99c3d9a6b54d43a7a9bcfe57b1f7f469; hb_MA-A976-948FFA05E931_source=www.baidu.com; WM_TID=FnTVRQrj75JFAVAUAVYpLtgFCUC00fNJ; P_INFO=176***********|1544579809|1|imooc|00&99|null&null&null#CN&null#10#0|&0||17638564503; NTESSTUDYSI=8259facdbcf54eebbb98ee0b438c10b2; utm="eyJjIjoiIiwiY3QiOiIiLCJpIjoiIiwibSI6IiIsInMiOiIiLCJ0IjoiIn0=|aHR0cHM6Ly93d3cuYmFpZHUuY29tL2xpbms/dXJsPURJc1lveUp6SVBuVUNBRUp2SkdvOU5CV3k1MVlidFVGOGFMUlktZGZCc0Q0V1BUNkgwUm5HM1N3ZHh3cUk3QXkmd2Q9JmVxaWQ9ZGI3YmQxZDgwMDAzZmQ3MDAwMDAwMDAzNWMxOTk5MGE="; __utma=63145271.1156471569.1544579763.1544579763.1545181455.2; __utmc=63145271; __utmz=63145271.1545181455.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; WM_NI=uB9OxGY%2Ff%2FUg2M2gqw6Ix3qwvOcP%2BlFtk7iePzDjB4QKd1Y6hxVMHgYe9Kkwq2t7v%2Bu2Bnax1nHcMckQaOMyPpUzP57cBZ68p1NHiD%2FeWHO0b%2F49o6ogUNOLPCqba5ISU0E%3D; WM_NIKE=9ca17ae2e6ffcda170e2e6ee9aaa40fc9c008ee25d81928fb2d14f978a8aabb76ff58fae97f16afcba8991f52af0fea7c3b92ab79ef7b0fb4d9bf1aad0d86df293fe88f47df697b8d4f47db691adb1aa6886aca5d8ec6f94a68c8bc1409395acd2dc3eaca89aaecb6d9bbbf7acea7db3eebcd8f521b7ee8e8fe474f3b28884d069a98fafb0d07394b09b9bd33ff5bd8ebbb534b4ef82a9ec50edbb99a9ce3ca2f1fcdaee3eadb99bafce48949dbf83e43f8b8d9bd1c837e2a3; __utmb=63145271.7.9.1545181499475');
curl_setopt($curl, CURLOPT_HEADER, 0); //0表示不输出Header,1表示输出
// curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = http_build_query($data);
curl_setopt($curl, CURLOPT_REFERER, $referer);
if(!empty($data)){
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($curl);
echo '<pre>';
$dataArr=json_decode($data,true);
var_dump($dataArr['result']['result'][0]);