# PHP csv import - with commas in datafields

**URL:** <https://forum.kirupa.com/t/php-csv-import-with-commas-in-datafields/249345>\
**Category:** programming\
**Created:** [January 17, 2008, 6:56pm UTC](https://forum.kirupa.com/t/php-csv-import-with-commas-in-datafields/249345 "2008-01-17T18:56:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [January 17, 2008, 6:56pm UTC](https://forum.kirupa.com/t/php-csv-import-with-commas-in-datafields/249345/1 "2008-01-17T18:56:39Z")

</div>

Hi Guys,

I’m importing a CSV file to mysql using PHP using the usual methods.

Obviously im splitting strings at commas - but the problem is that some of the data also contains commas!

How do i differentiate between the commas that are data, and the commas that separate my fields??

Really appreciate any input!
