PHP - Add null character to string -


i'm trying append number of null characters '\0' string in php.

$s = 'hello'; while(strlen($s) < 32) $s .= '\0'; 

however, php adds 2 characters (\ , 0), instead of escaping character , adding null. know add null character string?

i don't know if \0 correct in case, should use ":

$s = 'hello'; while(strlen($s) < 32) $s .= "\0"; 

Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -