0

what i want to do is find a word from a text file and delete that word using php plzzzzzzzzz help me.........

i can find the word using this codes

$handle = file_get_contents("files.txtl",NULL);
$a="first";
$a=substr_replace($a, '0', 0);
$a=explode(" ",$a);
$c=0;
foreach($a as $y){
if (stristr($handle,"$a[$c]")) $b[]= 'yes';
else $b[]='no';
$c++;
}
if (in_array("no",$b)) echo '<br><br>did not match';
else echo '<br><br>we have a match';
4
Contributors
6
Replies
12
Views
8 Years
Discussion Span
Last Post by diafol
0
$strText = file_get_contents( 'file.txt' );

$strFind = 'word';

$blMatch = false;

if( preg_match( "/$strFind/", $strText ) ) {

[INDENT]$blMatch = true;

$strText = str_replace( $strWord, '', $strText );[/INDENT]

}

That will tell you if your word is found, and it will remove it from the string.

R.

0

hello;
what i want to do is find a word from a text file and delete that word using java netbeans plz help me.........

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.