I scan used schoolbook barcodes into a textarea. 😃 If I scan a "33333" barcode, that means the Previous book is to be graded as NEW. :eek:
My problem is not getting PHP to read the textarea (easy! I know how to use "explode"), but getting PHP to list a unique ISBN number with BOTH a "new" and "used" grading. Here's an example of scanned Textarea input: :queasy:
2222222222
0132456987
33333
2456878965
2222222222
33333
Okay, you'll notice that I scanned ISBN 2222222222 twice -- once as a Used book, and once as a New book. Here's my PHP page desired Result:
2222222222: 1u, 1n
0132456987: 0u, 1n
2456878965: 1u, 0n
So, to get the scanned ISBNs into an array, I use explode ($arr = explode("\n",$textareaData)). Followed by array_unique.
But my Knowledge of PHP is very, very weak in building arrays.
Would someone please give me the line(s) of code?