goo*_*ons 2 php string null padding
我正在尝试将多个NULL字符'\ 0'附加到PHP中的字符串中.
$s = 'hello';
while(strlen($s) < 32) $s .= '\0';
Run Code Online (Sandbox Code Playgroud)
但是,PHP添加了2个字符(\和0),而不是转义字符并添加NULL.有没有人知道在字符串中添加NULL字符?
我不知道\0
你的情况是否正确,但你应该使用"
:
$s = 'hello';
while(strlen($s) < 32) $s .= "\0";
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7820 次 |
最近记录: |