Re: StrPos/stristr
| From: | Marek Kilimajer | Date: | Tue, 04 Mar 2003 12:40:12 +0000 |
| Subject: | Re: StrPos/stristr | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138087@lists.php.net to get a copy of this message | ||
$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