PHP CURL实现页面跳转并POST数据

记录 | php

$ch = curl_init();
$data = array('name' => 'Foo', 'age' => 25);
curl_setopt($ch, CURLOPT_URL, 'http://localhost/test.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);

吴尼玛

computer loser

可能感兴趣的文章

宝塔安装SSH2拓展

宝塔安装SSH2拓展

August 22nd , 2020
PHP三元运算符

PHP三元运算符

March 10th , 2020
点击撰写评论