Jump to content

how to find a keyword on a file


gudfry

Recommended Posts

Hi all,

 

I would like to find a word stored in a text file.

 

  if I found a word in text file like this /* $Author : Cahd */

 

  I want to ouput it as  Auhtor : Chad

 

  I looks like this

 

    $line = fopen('test.php');

foreach($line as $Line) {

        echo '<p>'.$Line.'</p>';

 

$output=processLine('$line');

if (processLine('/* $Author : Chad */')) {

 

if (gettype($output)=="array")

echo '<p>Title: '.($output[0]).' Value: '.$output[1].'</p>';

else

echo '<p>Not a string according to definition</p>';       

}

    }

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/115979-how-to-find-a-keyword-on-a-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.