<div>1 function api_notice_increment($url, $data)<br> 2 {<br> 3 $ch = curl_init(); <br> 4 curl_setopt($ch, curlopt_header,0);<br> 5 curl_setopt($ch, curlopt_returntransfer, 1);<br> 6 <br> 7 curl_setopt($ch, curlopt_url, $url);<br> 8 curl_setopt($ch, curlopt_post, 1);<br> 9 curl_setopt($ch, curlopt_postfields, $data);<br>10 $lst['rst'] = curl_exec($ch);<br>11 $lst['info'] = curl_getinfo($ch);<br>12 curl_close($ch);<br>13 return $lst;<br>14 }<br>15 $url = "http://localhost/test/post.api.php教程?app=test&act=testact";<br>16 $data = array (<br>17 'goods_id' => '1010000001224',<br>18 'store_id' => '20708',<br>19 'status' => 'goodsdownshelf',<br>20 );</div>
<div> <?php <br />error_log(var_export($_post,1),3,'d:/post.txt');</div>
'goods_id' => '1010000001224',
'store_id' => '20708',
'status' => 'goodsdownshelf',
)
<div>1 <?php <br /> 2 function api_notice_increment($url, $data)<br> 3 {<br> 4 $ch = curl_init(); <br> 5 curl_setopt($ch, curlopt_header,0);<br> 6 curl_setopt($ch, curlopt_returntransfer, 1);<br> 7 <br> 8 curl_setopt($ch, curlopt_url, $url);<br> 9 curl_setopt($ch, curlopt_post, 1);<br>10 $data = http_build_query($data);<br>11 curl_setopt($ch, curlopt_postfields, $data);<br>12 $lst['rst'] = curl_exec($ch);<br>13 $lst['info'] = curl_getinfo($ch);<br>14 curl_close($ch);<br>15 return $lst;<br>16 }<br>17 $url = "http://localhost/test/post.api.php?app=test&act=testact";<br>18 $data = array (<br>19 'goods_id' => '1010000001224',<br>20 'store_id' => '20708',<br>21 'status' => 'goodsdownshelf',<br>22 );<br>23 <br>24 <br>25 api_notice_increment($url,$data);</div>
'goods_id' => '1010000001224',
'store_id' => '20708',
'status' => 'goodsdownshelf',
)
php免费学习视频:立即使用
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!










