gudfry Posted July 22, 2008 Share Posted July 22, 2008 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>'; } } Quote Link to comment Share on other sites More sharing options...
mga_ka_php Posted July 22, 2008 Share Posted July 22, 2008 use regex Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.