Created
September 7, 2021 06:40
-
-
Save Merazsohel/23316c1f04f549888309cea0dde40103 to your computer and use it in GitHub Desktop.
Serially bulk barcode generate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$barcodes = []; | |
$from = explode("-", $request->input("from")); | |
$to = explode("-", $request->input("to")); | |
$totalDigit = strlen($from[1]); | |
$startFrom = (int) $from[1]; | |
$endTo = (int) $to[1]; | |
for ($i = $startFrom; $i <= $endTo; $i++) { | |
$barcode = $from[0] . "-" . str_pad($i, $totalDigit, "0", STR_PAD_LEFT); | |
array_push($barcodes, $barcode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment