亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

php程序內(nèi)部post數(shù)據(jù)的方法

 更新時間:2015年03月31日 10:11:25   作者:songguo  
這篇文章主要介紹了php程序內(nèi)部post數(shù)據(jù)的方法,涉及curl的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了php程序內(nèi)部post數(shù)據(jù)的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

$postData = array();
$postData['data1'] = "testdata1";
$postData['data2'] = "testdata2";
$postData['data3'] = "testdata3";
$url='http://yourdomain/do.php';
$str="";
foreach ($postData as $k=>$v)
{
  $str.= "$k=".urlencode($v)."&";
}
$postData=substr($str,0,-1);
$c = curl_init();
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_HEADER, 0);
curl_setopt($c, CURLOPT_URL,$url);
curl_setopt($c, CURLOPT_POSTFIELDS, $postData);
$result = curl_exec($c);

希望本文所述對大家的php程序設(shè)計有所幫助。

相關(guān)文章

最新評論