여기서는 다른 모든 입력에 사용할 수있는 코드를 사용하지만 hospital
이 아닌 이유는 무엇입니까?왜 일부 경우 preg_match()가 일치하지 않는가
다른 필터를 제안하면이 필터를 사용해 주시면 대단히 감사하겠습니다.
데모를 참조하십시오 :이it
이 있기 때문에
$type = strtolower("hospital");
if(preg_match('/it|IT|it services|it service|it infrastructure|it infrastructures/',$type)){
$img = "images/it1-200x111.jpg";
}else if(preg_match('/business|business solutions|biz solutions|business solution|biz solution/',$type)){
$img = "images/business-200x111.jpg";
}else if(preg_match('/manpower|manpower solution|manpower solutions|manpower services|manpower service|human resource|human resources/',$type)){
$img = "images/mp-1-200x111.jpg";
}else if(preg_match('/financial|finance|financial solution|financial solutions|financial service|financial services/',$type)){
$img = "images/fin-200x111.jpg";
}else if(preg_match('/marketing|marketing solution|marketing solutions|marketing service|marketing services/',$type)){
$img = "images/mark1-200x111.jpg";
}else if(preg_match('/real estate|real estates|real estate solution|real estates solution|real estate solutions/',$type)){
$img = "images/real1-200x111.jpg";
}else if(preg_match('/school|schooling services|school services|schools service|schooling service/',$type)){
$img = "images/school1-200x111.jpg";
}else if(preg_match('/college|college service|college services|colleges/',$type)){
$img ="images/coll1-200x111.jpg";
}else if(preg_match('/hospital|hospitals|hospital service|hospital services/',$type)){
$img = "images/hosp-1-200x111.jpg";
}else{
$img = "images/it1-200x111.jpg";
}
echo $img;
병원이 URL에있을 때를 의미합니다. 작동하지 않습니다. ..? –
병원에'it'이 있기 때문에 – jamesjaya
$ 유형은 입력 할 조건을 결정하지만 병원 섹션에 입력하지 않습니다. 다른 사람이 입력하는 경우 – EaBangalore