<?
function strToArr($str){
$d=explode(',',$str);
	if(empty($d)){return false;}
	else {return $arr;}
}

function arrToStr($arr){
$back='';
	if(!empty($arr)){
		foreach($arr as $i=>$v){
		$back.=','.$v;
		}
	}
return $back;	
}
function displayBday($d,$tamp){
$b=explode('-',$d);
	if($tamp=='full'){return $b[2].'-'.$b[1].'-'.$b[0];}
	else {return $b[1].'-'.$b[0];}	
}


function curURL() {
$pageURL = 'http';
// if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];}
	else {$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];}
 return $pageURL;
}	


function curIP(){
	if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    $ip = $_SERVER['HTTP_CLIENT_IP'];
	} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
    $ip = $_SERVER['REMOTE_ADDR'];
	}
return $ip;
}


?>