NYCPHP Meetup

NYPHP.org

[nycphp-talk] determining tab delimited or comma separated

Analysis & Solutions danielc at analysisandsolutions.com
Mon May 19 01:08:58 EDT 2003


On Sat, May 17, 2003 at 06:41:52PM -0400, Peter Lehrer wrote:
> Is there a built-in function which determines if a record in a file is tab
> delimited or comma separated?

No.  But you could make a guess by doing explode(',', $line) and 
explode("\
", $line) and see which one produces the number of expected 
array elements.

As Hans suggested, a file should be in one format.

--Dan

-- 
     FREE scripts that make web and database programming easier
           http://www.analysisandsolutions.com/software/
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7th Ave #4AJ, Brooklyn NY    v: 718-854-0335   f: 718-854-0409



More information about the talk mailing list