Example Analysis of post data in php Program
This article mainly introduces the php program internal post data example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The specific implementation methods are as follows:
$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); Thank you for reading this article carefully. I hope the article "sample Analysis of post data within php programs" shared by the editor will be helpful to you. At the same time, I hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!