Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- SplFileObject::fgetcsv with alternative delimiter --FILE-- <?php $fp = fopen('Spl..
Decoded Output download
--TEST--
SplFileObject::fgetcsv with alternative delimiter
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv6.csv', 'w+');
fwrite($fp, '"aaa","b""bb","ccc"');
fclose($fp);
$fo = new SplFileObject('SplFileObject__fgetcsv6.csv');
var_dump($fo->fgetcsv(',', '"', '"'));
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv6.csv');
?>
--EXPECT--
array(3) {
[0]=>
string(3) "aaa"
[1]=>
string(4) "b"bb"
[2]=>
string(3) "ccc"
}
Did this file decode correctly?
Original Code
--TEST--
SplFileObject::fgetcsv with alternative delimiter
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv6.csv', 'w+');
fwrite($fp, '"aaa","b""bb","ccc"');
fclose($fp);
$fo = new SplFileObject('SplFileObject__fgetcsv6.csv');
var_dump($fo->fgetcsv(',', '"', '"'));
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv6.csv');
?>
--EXPECT--
array(3) {
[0]=>
string(3) "aaa"
[1]=>
string(4) "b"bb"
[2]=>
string(3) "ccc"
}
Function Calls
fopen | 1 |
fwrite | 1 |
Stats
MD5 | 483b87a51773c3af0707db5463da7e23 |
Eval Count | 0 |
Decode Time | 87 ms |