Where is $line coming from?  The function won't output what you don't input.
Other than that I don't see anything wrong.
- Kevin


----- Original Message -----
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 4:33 PM
Subject: [PHP] syntax error


> Sigh :) It all works so much better if I use:
>
>     if(eregi('^au: (.*)$',$line,$m)) {
>
> But I want to use a function. But nothing is returned. So what did I do
wrong now?
>
> ----------snip------------
> echo filter_strings("au:");
>
> function filter_strings($tofilter){
> echo $tofilter."<br>";
> #    if(eregi('^$tofilter (.*)$',$line,$m)) {
>       if(eregi('^'.$tofilter.' (.*)$',$line,$m)) {
>         $filtered=$m[1];
>  echo "aa $filtered<br>";//nothing echoes.
>         return $filtered;
>      }
> }
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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

Reply via email to