PHP 编写连续单引号时出现问题


PHP problem writing consecutive single quotes?

我无法在我的服务器上写连续的单引号;这个简单的脚本输出只是文件的单引号:

<?php
    $handle = fopen('testWriteDoubleSingleQuote.dat', 'wb');
    fwrite($handle, "''");  //  only writes ' ONCE!
    fclose($handle);
?>

我也尝试了 pack() 函数,结果相同:

<?php
    $handle = fopen('testWriteDoubleSingleQuote.dat', 'wb');
    fwrite($handle, pack('nnn', 0x6061, 0x6127, 0x2763));  //  only writes 0x27 ONCE!
    fclose($handle);
?>

这正常吗? 与魔术报价有关?

你试过四个吗? fwrite($handle, "''''");