Thread: PHP Guys - Help
View Single Post
Old 02-03-2005, 06:24 AM  
Dusen
Confirmed User
 
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
PHP Guys - Help

I'm trying to spit out some poor code and am curious if I can improve my method.

In a funciton, I'm searching a string for several different strings. If it is found, I want to return "Found".

$valxx=in_string("variable1",$input);
if ($valxxhahahaha"true") { $returnval="Found"; return($returnval); }

$valxx=in_string("variable2",$input);
if ($valxxhahahaha"true") { $returnval="Found"; return($returnval); }

$valxx=in_string("variable3",$input);
if ($valxxhahahaha"true") { $returnval="Found"; return($returnval); }

$valxx=in_string("variable4",$input);
if ($valxxhahahaha"true") { $returnval="Found"; return($returnval); }


Is there any way I can load the "variable1,variable2" into an array and do it in a single statement?

Thanks
__________________
Penis Pill Sponsor List and Reviews:
http://www.pillsponsors.com
Dusen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote