Re: Function Troubles!
| From: | Damian Harouff | Date: | Mon, 05 Aug 2002 07:33:55 +0000 |
| Subject: | Re: Function Troubles! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111151@lists.php.net to get a copy of this message | ||
Perhaps to try strstr instead of strpos?
http://www.php.net/manual/en/function.strstr.php
DaSn> I'm having trouble with a function I've been working on - I can't seem to
DaSn> get the learn() function to trigger! Is there a flaw in my logic?
DaSn> Here's my code:
DaSn> <?
DaSn> function damn_it_all_to_hell($poster, $anotherpost)
DaSn> {
DaSn> if ( is_constructive($anotherpost) )
DaSn> {
DaSn> echo $anotherpost;
DaSn> if(strpos($anotherpost, 'answer'))
DaSn> {
DaSn> learn(); // <-- this is where my problems are
DaSn> } else {
DaSn> teach();
DaSn> }
DaSn> }
DaSn> if ( is_worthless($anotherpost) || strpos($anotherpost, $complaint) )
DaSn> {
DaSn> block_poster($poster);
DaSn> unset($anotherpost);
DaSn> die;
DaSn> }
DaSn> }
DaSn> damn_it_all_to_hell($this_poster, $this_message);
?>>
DaSn> Your words and actions will either encourage, educate, and entertain, or
DaSn> discourage, mislead, and depress. The former has always worked better for
DaSn> me.
DaSn> Dave
DaSn> p.s. - I know this isn't the philosophy list, but see damn_it_all_to_hell()
DaSn> above for a useful function.