Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- comma delineated files
November 2, 2005, 1:45 am
rate this thread
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?
Re: comma delineated files
that can be between the commas. Another valid file is as follows:
Given this, the regular expression is, at the very least, not going to
be particuraly easy. Before making the original post, I was unable to
come up with a sufficient one for preg_split.
As such, if regular expressions are the key, I could still use some