Hi,
supose that i have in a file:
login:login@test.com //line 1
user:user@domain.com //line 2
Line 1 and 2 has at the end of the line \n .
because of: fputs($file, "$user:$mail\n");
Now i want to add to the line 1 also his telephone number. So i write the next code
for ($i=0; $i < $indi; $i++){ //$indi=count($array);
$usr= explode(":",$array[$i]); //$array is the array of file im using
if ($usr[0]=="$user"){
$sizee= count($usr);
$usr[$sizee]=$tel;
$temp=implode(":",$usr);
fputs($archi,"$temp"); $flag=1; unset($temp)
}
}
But in step of adding in the line 1, it add it on the line 2. Because of the \n.
like this:
login:login@test.com //line 1
4855984:user:user@domain.com //line 2
so it add in on te next line.
How can i solve this?
Theres any way of deleting the "\n" of a string?
Thanks