Eiolon Posted July 22, 2008 Share Posted July 22, 2008 I have a script that queries a database of barcodes. The barcodes always start with 29971 and have an additional 9 numbers after it. I need a way to make sure anything that does not start with 29971 gets rejected. Any ideas? Quote Link to comment Share on other sites More sharing options...
Stephen Posted July 22, 2008 Share Posted July 22, 2008 Try something like: $_barcode=29971042354455; if (substr(strval($_barcode),0,5)==="29971")) { echo("Correct"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.