A client uses a custom-built software that manages their products catalog and this software generates a flat file which I can use to populate mySQL database for the online shop. Simple example of the flatfile:
Code: Select all
Title|iPod
Price|200
Stock|10
Title|iPod Blue
Price|200
Stock|10
etc...
I managed to write a script (using foreach, etc.) that adds the products to the database but I spotted a little problem. If a product has a rather long title or description, the format looks like this:
Code: Select all
Title|iPod the pink one with
Title|protective case and
Title|personalised wallpaper
Price|300
Stock|20
Title|iPod
Price|200
Stock|10
So the title field in database contains only the value "personalised wallpaper" rather than the full title e.g. "iPod the pink one with protective case and personalised wallpaper".
Is there a PHP function or something that allows me to concat or merge values based on same key?
Many thanks in advance!
