Wednesday, January 28, 2015

Newline Remover

<pre>
$lines=file('readerfile.txt');
$fp=fopen('writerfile.txt','w');
var_dump($lines);
foreach($lines as $line){
if($line=='\r\n' || $line=='\n' || $line=='\r' || $line==' ' || empty($line) || strlen(trim($line))==0){
echo '123';
}
else{
fwrite($fp,$line);
}
}
</pre>
watch the below picture:

<a href="http://ashique12009.files.wordpress.com/2011/07/newlineremover.jpg"><img class="alignnone size-full wp-image-75" title="newlineremover" src="http://ashique12009.files.wordpress.com/2011/07/newlineremover.jpg" alt="" width="450" height="129" /></a>

No comments:

Post a Comment

Change priority of dual boot OS

Change priority of dual boot OS  (Windows and Linux): Go to your Linux OS, install Grub customizer. Then change priority by up and down arro...