zero-perfoliate
zero-perfoliate

Author Topic: string deleting  (Read 167 times)

Offline monk123

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
string deleting
« on: November 09, 2010, 05:37:37 PM »
Hi,

I am new to php and need help over very simple script.

  $strText = file_get_contents( 'ww.google.com/file.php' );

$strFind = 'word';

$blMatch = false;

if( preg_match( "/$strFind/", $strText ) ) {
$blMatch = true;

$strText = str_replace( $strFind, '', $strText );
}

now in text file content are like this

"word is very usefull and have meaning full things."

Now I want that if the script has find "word is very usefull" it should remove the whole line, not only that particular word.


Anyone can help me in this case?  :)