Take a look at some bar code. Under it, you should find a number. The bar code is a representation of this particular number adapted to ... bar code reader machines. It is vastly simpler to program bar code detection than a character recognition process. The point is that a bar code is just a number (well, not just, there are standards).
There are two processes invoved here.
1° Creating bar codes : this can be achieved by using the GD library.
2° Inputing bar codes : the bar code scanner output can be a flat file. So what you have to do is to take a look at the output and build a parser.
But, even if you could do this easily with PHP, I do not really see the point of doing this kind of work with web interface, and I would prefer to use a standalone application that will not need the ressources of a web server and PHP to work.