👾 php

php if, switch

(。θᗨθ。) 2022. 12. 15. 12:44
<h2><?php
	$sruri = $_SERVER["REQUEST_URI"];
    
    if($getCookieLang === "ko"){  //한국어
      if(strpos($sruri, 'cylinder')) echo '유압실린더';
      if(strpos($sruri, 'pump')) echo '유압펌프';
      if(strpos($sruri, 'equipment')) echo '유압장비';
      if(strpos($sruri, 'HLS')) echo '유압시스템';
      if(strpos($sruri, 'transfer')) echo '이송시스템';
      if(strpos($sruri, 'bolting')) echo '볼팅툴';
      if(strpos($sruri, 'partner')) echo '파트너';
    } else if($getCookieLang === "en") {	//영어
      switch($_GET['bo_table']){
        case 'pd_cylinder' : echo "Hydraulic Cylinder"; break;
        case 'pd_pump' : echo "Hydraulic Pump"; break;
        case 'pd_equipment' : echo "Hydraulic Equipment"; break;
        case 'pd_HLS' : echo "Heavy Lifting System"; break;
        case 'pd_transfer' : echo "Transfer System"; break;
        case 'pd_bolting' : echo "Bolting Tool"; break;
        case 'pd_partner' : echo "Partner"; break;
      } 
    }
?></h2>
728x90