Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of post data in php Program

Shulou Source: shulou.com Published: 2022-06-03 19:45:50 11月12日 Update

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!

Tags: Articles data examples programs analysis value interest at the same time methods more friends knowledge editing industry information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno macOS NVidia Apple MySQL