是否可以使用php检测USB设备? [英] Is it possible to detect usb devices using php?

查看:40
本文介绍了是否可以使用php检测USB设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

USB 鼠标、键盘或闪存驱动器在使用 php 连接时是否可以检测到它们?

Is it possible to detect usb mouse,keyboard or flash drives when they are connected using php?

推荐答案

哪一边 - 服务器端或客户端?

Which side - server side or client side?

服务器端:可能,虽然可能不是一个好主意.您可以调用操作系统特定的函数或 shell 命令来访问 USB(例如 shell_exec("lsusb -v"); ),并处理结果.

Server side: possible, although probably not a good idea. You would call OS specific functions or shell commands to access USB (e.g. shell_exec("lsusb -v"); ), and process the results.

客户端:不可以.PHP 只能在服务器端工作.

Client side: No. PHP just works on server side.

命令行 PHP:与服务器端相同.

Commandline PHP: same as Server side.

您使用了错误的工具来完成这项工作.返回并使用更适合该任务的一种.

这篇关于是否可以使用php检测USB设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆