Psyche
Psyche

Reputation: 8773

Reading data from a various terminals using PHP

I would like to know if there's by any chance a way to communicate with a POS device, a cash register and a magnetic card reader with PHP. By communications I mean reading the output of that device.

Thank you.

Upvotes: 4

Views: 157

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270607

Those devices often support serial communication. PHP doesn't have built-in serial terminal support to my knowledge, but here's a class that facilitates it.

Beyond this, depending on the platform you are running, reading and writing to a serial port may merely consist of reading and writing the correct byte streams from a character device like /dev/ttyS0 using fopen() fread() fwrite() on the device's file descriptor.

Upvotes: 2

Related Questions