<?php 	
	$as = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
	$url =explode("/",$as);
	//$as = $_SERVER['REQUEST_URI'];
	$count = count($url);
	for ($i=0;$i<=$count;$i++){
		$a = $i;
		if ($url[$i]==$mainUrl){
			break;	
		}
	}
	
	$link = $url[$a+1];
	$xcode = $url[$a+2];
	$xcode2 = $url[$a+3];
	$xcode3 = $url[$a+4];
	$xcode4 = $url[$a+5];
	
	if ($link==''){
		$content = 'add-transaksi-grup.php';
	}elseif ($link=='index'){
		$content = 'add-transaksi-grup.php';	
	}else{
		$content = "".$link.".php";
	}
	
	
	
	
	function cleanURL($string)
	{
		$url = str_replace("'", '', $string);
		$url = str_replace('%20', ' ', $url);
		$url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); // substitutes anything but letters, numbers and '_' with separator
		$url = trim($url, "-");
		$url = iconv("utf-8", "us-ascii//TRANSLIT", $url);// you may opt for your own custom character map for encoding.
		$url = strtolower($url);
		$url = preg_replace('~[^-a-z0-9_]+~', '', $url); // keep only letters, numbers, '_' and separator
		return $url;
	}
?>
