replacing null values and line breaks in file



Hi Gurus

I want to replace null values with a space and line breaks with a |
symbol in a file. I have written the following function:

function replace_characters($path, $file) {
$str = file_get_contents($path.$file);
$str = str_replace("\r\n", "jjjjjjjjjjjjjj", $str);
file_put_contents($path.$file);
}

How do I replace the null value

TIA

Nicolaas

.