php 使用命令行函数exec($sql,$result,$status);
$sql 命令 $result 返回东西 $status成功与否的状态
例如:
php使用命令行去执行数据库备份(详情在这里)
$exec="mysqldump -h localhost -uroot -pXiaozuanfeng --default-character-set=utf8 we8 > /var/www/backsql/we8".$time.".sql"; exec($exec, $result, $status);
php 几天前的时间(或几天后)
$backtime = date("Y-m-d",strtotime("-5 day"));
$backtime = date("Y-m-d",strtotime("+5 day"));
php 获取文件函数 file_get_content(.txt;.log.cvs文件)
php 数组排序array_multisort($volume, SORT_DESC, $edition, SORT_DESC, $vo, SORT_DESC, $ed, SORT_DESC, $res);
foreach ($res as $key => $row) { $volume[$key] = $row['pan_man']; $edition[$key] = $row['order_man']; $vo[$key] = $row['pv']; $ed[$key] = $row['uv']; } if(!empty($res)){ array_multisort($volume, SORT_DESC, $edition, SORT_DESC, $vo, SORT_DESC, $ed, SORT_DESC, $res); }
转载于:https://www.cnblogs.com/lvtiansong/p/9373177.html
相关资源:PHP常用函数总结.pdf