dongyuluan7494
dongyuluan7494
2011-05-11 19:01

PHP问题写连续单引号?

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?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongmoyu0336 dongmoyu0336 10年前

    Did you try four? fwrite($handle, "''''");

    点赞 评论 复制链接分享

为你推荐