0

As the title says, I am trying to open a CSV file that is comma delimited and I need to update specific part of the CSV string. Is that possible? I have looked into fseek but that only let's me count the number of bytes from the BOF so that won't work as each CSV would be different.

I was thinking if it was possible if I set the specific part I want to change with something like "CHANGEME" and have PHP look for that string/character and replace that with whatever I need.

Possible?

2
  • what is your goal, can't you just treat it as regular text file? Commented Jul 19, 2011 at 0:58
  • csv file gets created at stage 1 but at stage 2 there is a certain data that needs to go into the csv...and no I can't just create the csv after stage 2 Commented Jul 19, 2011 at 1:00

1 Answer 1

1

Try fgetcsv (documentation) or str_getcsv.

Maybe these functions will help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.