Reply to remove all lines starting with b

Your name:

Reply:


Posted by yawnmoth on 10/18/34 11:43

Say I have the following file - dummy.txt:

a 4treg
a sdfas
a 4egdsag
b 1111
a ergdsfg
b 1111
c waefasdf

How would I go about removing all the lines that begin with a b? I
thought the following script (which I wrote with the intention of
replacing all such lines with the empty string) would but apparently it
doesn't:

<?
$contents = file_get_contents('dummy.txt');
echo "\r\n";
echo preg_replace('/^b.*?\n/','',$contents);
?>

Any ideas?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация