Re: replacing null values and line breaks in file
- From: "windandwaves" <nfrancken@xxxxxxxxx>
- Date: 22 Nov 2006 16:32:57 -0800
windandwaves wrote:
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
This is what I did:
$nullcharacter= chr(0);
$str = str_replace($nullcharacter, "", $str);
OR
$str = str_replace("\0", "", $str);
HTH
Nicolaas
.
- References:
- replacing null values and line breaks in file
- From: windandwaves
- replacing null values and line breaks in file
- Prev by Date: replacing null values and line breaks in file
- Next by Date: Re: Lost formatting in browser 'view source'
- Previous by thread: replacing null values and line breaks in file
- Index(es):