php str_replace null character code example
Example 1: php remove null bytes from string
$text = str_replace("\0", "", $text);
Example 2: replace all occurrence char in string php
$string = str_replace('search','replace',$string);
$text = str_replace("\0", "", $text);
$string = str_replace('search','replace',$string);