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

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -