//get linking command if(preg_match('/nolink/i',$param)){ $linking = 'nolink'; }else if(preg_match('/direct/i',$param)){ $linking = 'direct'; }else if(preg_match('/linkonly/i',$param)){ $linking = 'linkonly'; }else if(preg_match('/details/i',$param)){ $linking = 'details'; }else{ $linking = 'nolink'; }