|
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]
|