You are here: comma delineated files « PHP Programming Language « IT news, forums, messages
comma delineated files

Posted by yawnmoth on 11/02/05 03:45

Say I have an file whose contents are as follows:

"test","com,ma","food"

How would I go about turning that file into an array, as follows?:

$file_contents = array('"test"','"com,ma"','"food"');

Doing explode(',',$file_contents) wouldn't be sufficient because the
resultant array would have four entries - not three - and would instead
read like this:

$file_contents = array('"test"','"com','ma"','"food"');

I could probably iterate through each character within the array, but
that, it seems to me, would be inefficient. Plus, it'd require more
code that'd be nice to avoid.

So, anyway, any ideas?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация