$text = str_replace("\0", "", $text);
will replace all null characters in the $text string. You can also supply arrays for the first two arguments, if you want to do multiple replacements.
$text