成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

curl命令詳解 php怎么獲得頭文件中的Set-Cookie?

php怎么獲得頭文件中的Set-Cookie?引用如下:/*---save cookie-----*/$url=“IP”//url address$post=“id=user&pwd=12345

php怎么獲得頭文件中的Set-Cookie?

引用如下:/*---save cookie-----*/$url=“IP”//url address$post=“id=user&pwd=123456”//post data$ch=curluinit($url)//initialize curlusetopt($ch,CURLOPTuheader,1)//輸出curl作為數(shù)據(jù)流usetopt($ch,CURLOPTureturn transfer,1)//返回輸出文本流curlusetopt($ch,CURLOPT Postfields,$post)//發(fā)送post數(shù)據(jù)$content=curl Exec($ch)//執(zhí)行curl并將值賦給$content preg Match(“/設(shè)置Cookie:()。*)/IU“,$content,$STR)//常規(guī)匹配$cookie=$STR[1]//獲取cookie(會(huì)話ID)curluuclose($CH)//Close curl/*---使用cookie/*/curluuopt($CH,CURLOPTucookie,$cookie)