I can't manage to write consecutive single-quotes on my server; This simple script output's only a single quote to the file:
<?php
$handle = fopen('testWriteDoubleSingleQuote.dat', 'wb');
fwrite($handle, "''"); // only writes ' ONCE!
fclose($handle);
?>
I've tried the pack() function as well, with the same result:
<?php
$handle = fopen('testWriteDoubleSingleQuote.dat', 'wb');
fwrite($handle, pack('nnn', 0x6061, 0x6127, 0x2763)); // only writes 0x27 ONCE!
fclose($handle);
?>
Is this normal? Something to do with magicquotes?