首先需要掛載 php_dio.dll
程式實做如下
程式實做如下
php_dio.dll 可至http://cn.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror 這下載exec('mode COM1: baud=19200 data=8 stop=1 parity=n'); $fd = dio_open('COM1:', O_RDWR); while (1) { $data = dio_read($fd, 1); if ($data) { echo $data; } } dio_close($fd);