Let’s say I have this variable :
$Include = "Line 1;
//some Line 2 here";
and I want to write that variable into file and get exactly 2 lines like this :
Line1;
//some Line 2 here
but when I try to do it by using this code :
$Filename = 'somefile.php';
$Handle = fopen($Filename, "r");
$Contents = fread($Handle, filesize($Filename));
fclose($Handle);
$Contents = str_replace ('replace this', $Include, $Contents);
I see only one line like this :
Line 1; //some Line 2 here
how to make 2 lines using 1 variable? thanks
Try this: