Question : PHP: Combine many elseif for parsing search term

Is there a better way to do this?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
if(stripos($value,'?q=')>0) {
		$q=substr($value, 3+stripos($value,'?q='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'&q=')>0) {
		$q=substr($value, 3+stripos($value,'&q='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 if(stripos($value,'?p=')>0) {
		$str['search']=substr($value, 3+stripos($value,'?p='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'&p=')>0) {
		$str['search']=substr($value, 3+stripos($value,'&p='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'?search=')>0) {
		$str['search']=substr($value, 8+stripos($value,'?search='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'&search=')>0) {
		$str['search']=substr($value, 8+stripos($value,'&search='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'?term=')>0) {
		$str['search']=substr($value, 6+stripos($value,'?term='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	 elseif(stripos($value,'&term=')>0) {
		$str['search']=substr($value, 6+stripos($value,'&term='));
		$q=explode('&',$q);
		$str['search']=urldecode($q[0]);
	 }
	}

Answer : PHP: Combine many elseif for parsing search term

Hi

I have resolved the issue.  A DLL was missing from the XP Embedded OS - srclient.dll

I downloaded this DLL and now the PDF's show the text as expected rather than balnk documents.

Thanks

Random Solutions  
 
programming4us programming4us