跳转到主内容
极星编程网:以代码为星,赴技术山海!

php实战第十四天

今天学会了curl扩展的函数.写了一个 httppost函数,恩是有效的,这个我想可以利用来做在线更新.或者是在线下载远程的资源.

PHP 8.5.5 PHP 8.5.5 是 PHP 8.5 分支的维护更新版本。该版本延续了“小步快跑”的迭代逻辑,通过深度错误修复、底层性能微调以及安全加固,旨在为开发者提供一个更健壮、更高效的运行环境。该版本严格遵守语义化版本规范,不包含破坏性变更。

下载[php]echo httpPost("http://bbs.125.la/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1",array ("handlekey" => "ls","password" => "123456","quickforward" => "yes","username" => "admin"));function httpPost($url,$sendData){$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// 我们在POST数据哦!

curl_setopt($ch, CURLOPT_POST, 1);// 把post的变量加上curl_setopt($ch, CURLOPT_POSTFIELDS, $sendData);$output = curl_exec($ch);curl_close($ch);return $output;}echo httpPost("http://bbs.125.la/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1",array ("handlekey" => "ls","password" => "123456","quickforward" => "yes","username" => "admin"));function httpPost($url,$sendData){$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// 我们在POST数据哦!

curl_setopt($ch, CURLOPT_POST, 1);// 把post的变量加上curl_setopt($ch, CURLOPT_POSTFIELDS, $sendData);$output = curl_exec($ch);curl_close($ch);return $output;}以下是标准的mysql查询数据并组合成数组的代码[php]$conn=mysql_connect('localhost','root','1234');mysql_select_db('kefei');mysql_query("set names utf8");$result=mysql_query("select * from liuyan");$arr=array();while($row=mysql_fetch_assoc($result)){$arr[]=$row}var_dump($arr);

相关文章