$base_url = "https://www.scgroupthai.com/en/"; $base_url_redirect = "https://www.scgroupthai.com/en"; $arrLink=explode('.',$_SERVER['HTTP_HOST']); if(!in_array('www', $arrLink)) { //header("location:http://www.scgroupthai2.com".$_SERVER['REQUEST_URI']." "); } function clean($string) { $string = str_replace(' ', '-', $string); $string = preg_replace('/[^ก-๙A-Za-z0-9เ\-]/', '', $string); $string = preg_replace('/-+/', '-', $string); if(substr($string,0,1) == '-') { $string = substr($string,1); } if(substr($string,-1,1) == '-') { $string = substr($string,0,-1); } return $string; } $basename_url = basename($_SERVER['PHP_SELF'],'.php'); if($basename_url=='news') { $file=explode('news-detail',$_SERVER['REQUEST_URI']); $var=explode('/',$file[1]); $_GET['news_id'] = $var[1]; $_GET['news_rewrite']=$var[2]; $_GET['news_type']=$var[3]; } if($basename_url=='csr-detail') { $file=explode('csr-detail',$_SERVER['REQUEST_URI']); $var=explode('/',$file[1]); $_GET['csr_id'] = $var[1]; $_GET['csr_rewrite']=$var[2]; } ?>