Reputation: 305
I'm simply looking to take the first csv out of a string, using PHP. Here are a few examples:
And so on...
Thank you.
Upvotes: 0
Views: 419
Reputation: 3355
I suggest using str_getcsv or something similar that parses csv, this will take into account any quotation marks and commas in the CSV string. after that you can just array_shift
Upvotes: 1
Reputation: 16439
You can try this:
$csvArray = explode(",", $csv);
array_shift($csvArray);
$newCsv = implode(",", $csvArray);
Upvotes: 2