Re: syntax error
| From: | Kevin Stone | Date: | Wed, 05 Mar 2003 00:05:12 +0000 |
| Subject: | Re: syntax error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138193@lists.php.net to get a copy of this message | ||
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" <taylorjo@collegesherbrooke.qc.ca>
To: <php-general@lists.php.net>
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
>
>