In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Leif K-Brooks) wrote:

> One more question.  Is  there any way to use this with part of a string?
> Example:
> function checkfruitlove($string){
> $fruitarray = array("apples","oranges");
> if($string == "I love ".in_array($fruitarray)."!"){
> $return = "I do too!";
> }else{
> $return = "I don't!";
> }
> return $return;
> }
> $answer = chechfruitlove("I love apples!"); //returns "I do too!"
> $answer = chechfruitlove("I love oranges!"); //returns "I do too!"
> $answer = chechfruitlove("I love pears!"); //returns "I don't!" 

<http://php.net/preg-match>

-- 
CC

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

Reply via email to