本来想用python来写,一看python的代码不就是直接调用adb.exe执行命令吧。直接php不香吗。模拟屏幕滑动命令
// 执行adb命令 $command = 'adb shell input swipe 548 1088 105 871'; exec($command, $out_put, $res_code);
在项目中需要对图片进行裁剪,前端裁剪完成发送base64给后端,但是很意外的PHP获取到的数据和前端有点差距,之前我都是先加密,后端解密,但是这次依然不行。于是使用filter_input方法轻松解决。$base64 = filter_input(INPUT_POST...
使用php函数array_multisort()即可实现和SQL一样的order by排序. 例如我们需要对会员表按照主键降序排列,年龄升序排列://会员表数据 $list = []; $list[] = ['mid' =>&n...
面试中PHP面试官会问调用一个不存在的方法,如何知道是哪个文件哪行调用的?假设方法是getWorkLoad()回答1:开启PHP错误输出,PHP会输出Fatal error: Call to undefined function getWorkLoad() in D:\wwwroot\thinkpa...
<?php /** * @throws Exception */ function curl() { throw new \Exception('err...
php7新增的特性(1).强制限制只能返回一种类型<?php class task { } //must return an integer function add(): int { &nb...
<?php //如果支持exec函数,可以使用的方式 exec('chcp 65001'); //如果exec函数因安全问题禁用,可以使用的方式 pclose(popen('chcp 65001', 'r'));...