$lines=explode("\n",$something);

foreach($lines as $line) {
   if(eregi('^au: (.*)$',$line,$m)) {
       $au=$m[1];
       // you may want to break here
   }
}

John Taylor-Johnston wrote:

http://www.php.net/manual/en/function.stristr.php
http://www.php.net/manual/en/function.strpos.php

Input from a <textarea name=something>

I want to scan endless lines of $something. If the First Three characters
of any line begin with "au:" (case insensitive) I want to filter out that line,
and let $au = that line of text
up to but not including the \n. I was lo0oking at StrPos & stristr.

They don't quite do it do they? Then how do I?

John






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to