Hi I am looking to do a sort of find and replace using php.
I have a .csv file which I need to change some things in before I upload it to a database.
One of the lines of data in the file is as follows:
1832208,501455860,Vauxhall Astra 1.6 Active 5-Door Hatchback,4994,Ultra Blue,charcoal piazza cloth,28688,2004,MAR,SK04PHY,Manual,[Anti-lock brakes,Driver seat height adjustment,Driver and passenger air bags,Air-conditioning,Alloy wheels,Remote central Door locking,Manual Door mirrors,Front electric windows,Front/rear head restraints,Headlamp adjustment,5 speed manual gearbox,Power-assisted steering,Rear wash wipe,Rev counter,Split rear seat,Rake/reach adjustable steering column/wheel,Immobiliser,Compact disc player,Audio steering wheel mounted controls]
The part coloured in red above is where I have the problem. I need to
1) replace all of the , in this section with # and then
2) remove the square brackets
I can only manage to get one of the thing mentioned above to change I can't get it to change both things and in that order otherwise it will mess up the whole file.
Does any one have any suggestions?
Thanks





Bookmarks