This article mainly introduces the post data method in the php program, which involves curl usage skills and has some reference value. If you need it, you can refer
This article mainly introduces the post data method in the php program, which involves curl usage skills and has some reference value. If you need it, you can refer
This article describes the internal post data method of the php program. Share it with you for your reference. The specific implementation method is 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 );
I hope this article will help you with php programming.
,