php remove null bytes from string code example Example: php remove null bytes from string $text = str_replace("\0", "", $text);