Hi,

I have one csv file with same order id for 4 or 5 times. How to know that order id is 4 or five times.

My problem is on the basis of order id i will get the Product name and i want to generate the invoice.

If the cust. is purchasing the 1 or 2 or 3 or 4 or 5 products he will get on order id for one transaction. and the csv file shows the same data. now i will find the products on the same id and i will get product name, cost, vat etc fields... for generating invoice.


Order Id Billing Name Billing Address Telephone Billing country E-mail Recipient Name Shipping Address Transaction Date Amount Status Pay Type
1585764 LALIT TUTEJA # 646, Sector 40 A 9872685577 India lalit.tuteja@gmail.com N/A N/A 00:02.2 99 shipped Visa 0 0 0
1585764 LALIT TUTEJA # 646, Sector 40 A 9872685577 India lalit.tuteja@gmail.com N/A N/A 00:02.2 99 shipped Visa


Please help me......

Member Avatar for diafol
array_count_values ( )

will give the number of exact duplicates, but if you have differences like 000 and blank at the end this won't work.

Do you need to sum the values at the end?

BTW this looks like an odd setup. I'd look to change the way the csv was created rather than try to fix the file.

i would just phrase the csv to a array then sort the array by the order id then echo it because that would make all duplicates show up coupled with each other

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.