👾 php

PHP URI 에 따라 내용 변경

(。θᗨθ。) 2022. 5. 13. 09:06
<?php
  $sruri = $_SERVER["REQUEST_URI"];
  if(strpos($sruri, '/cs/') == true || strpos($sruri, '=cs_') == true) {
    echo '고객센터';
  } elseif (strpos($sruri, '/company/') == true) {
    echo '회사소개';
  } elseif (strpos($sruri, '/business/') == true) {
    echo '사업분야';
  } elseif (strpos($sruri, '/product/') == true) {
    echo '제품소개';
  } elseif (strpos($sruri, '/application/') == true) {
    echo '적용사례';
  };
?>
<?php
  $sruri = $_SERVER["REQUEST_URI"];
 ?>
<?php if(strpos($sruri, '/cs/') == true || strpos($sruri, '=cs_') == true): ?>
	내용
<?php elseif(strpos($sruri, '/company/') == true): ?>
	내용
<?php endif ?>
728x90