Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Deekshith's avatar

Read bar code and return the value of barcode

I am trying to create bar codes for each students and i want to give camera or video icon in browser where admin opens the website in browser and click on that icon and camera or video should open in browser itself and it returns the value. is there any way to achieve this? i found for qr code but not a barcode. any suggestions?

0 likes
5 replies
Tray2's avatar

Just so you know that there are a shitload of different encodings to a barcode.

  • code39
  • code128
  • ++ many more

You need to pick one that suits your need.

This package seems to good and easy to use. It only supports a few of the barcodes but for you I'd guess that code128 is good enough.

https://lindell.me/JsBarcode/

Deekshith's avatar

@tray2 this is for generator and thank you and also i need the reader to be implemented in browser itself just like this.

https://webqr.com/

and shall i store user roll number in qr code instead of bar code?

Tray2's avatar

If you don't use an external barcode reader there really isn't any purpose to create barcodes. When it comes to the browser a normal link should suffice. I see no need for the browser to be able to read the barcodes.

It really doesn't matter if you use a barcode, datamatrix or qr in your case. Datamatrix and qr can contain more information than a regular barcode that is only a string of text represented as bars.

Please or to participate in this conversation.