phpjs
Version:
54 lines (42 loc) • 1.03 kB
HTML
<!-- Generated by Rakefile:build -->
<strong>
<a href="http://jasonbutz.info" rel="nofollow">Jason Butz</a>
</strong>
on 2012-06-13 23:43:29 <br />
The following is not handled correctly.
<pre><code>
str_getcsv('"0","Text 1",0,0,0,0,0,"Text2"');
</code></pre>
It is parsed to
<pre><code>
[
'0',
'"Text 1",0,0,0,0,0,"Text2"'
]
</code></pre>
It should be
It is parsed to
<pre><code>
[
'0',
'Text 1',
'0',
'0',
'0',
'0',
'0',
'Text2'
]
</code></pre>
I am ignoring types, but I think you should get the idea. I'm not even I would consider types important.
<hr />
<strong>
Marques Johansson
</strong>
on 2012-03-16 16:50:17 <br />
<pre><code>
str_getcsv("'one','two with escaped \' single quote', 'three, with, commas',", ',', "'", '\\');
["one", "two with escaped ' single quote", "three, with, commas',"]
// The single quote + comma should not be included in the last part
</code></pre>
<hr />