Search And Replace String File Script

Search And Replace String File Script is used to if you need to find any one text and replace at with file.

Demo :



Find Text     Replace Text     
 
 

Example :

In the above demo Find Text box is used to find would you like to replce text and Replace Text box is used to would you like to replace text.For example you would like to replace php capital letter word to small letter, just type PHP capital word on Find Text box and type php small word on Replace Text box and then click replace button now will be replaced php word.

Code :

Following code is use to Search And Replace String File Script if you need code to copy and use to your website.


<?php
  include "File/SearchReplace.php";
  $text_file1='chapter_01.txt';
  $fsr = new File_SearchReplace(PHP,php, array($text_file1));
  $fsr->doReplace();
  echo $fsr->getNumOccurences() . " match(es) found.";
?>

In the above SearchReplace.php is a search and replace class file and $text_file1 variable is assign to text file and File_SearchReplace function have three arguments used that's first one is would like to want to replace text and second one is want replace function and third one is file name.

Free Download Script :

If you need to Search And Replace String File Script click and download from following link.

Download




Content