URL starts with 'www' and site is : $e[1]
"; $tmp = $e[1]; } else { //print "
Sub-domain found : $e[0]"; $tmp = $e[0]; } $siteid = fetch_me("websites","site_id","second_name",$tmp); $q = mysql_query("SELECT * FROM subject_site WHERE site_id = $siteid"); while($r = mysql_fetch_object($q)) { $subname = fetch_me("subject","sub_name","sub_id",$r->subject_id); if($sub_arr=="") $sub_arr = "\"".$r->subject_id."\""."=>\"".$subname."\""; else $sub_arr .= ",". "\"".$r->subject_id."\""."=>\"".$subname."\""; } //print "Array of subjects is: ".$sub_arr; //$pre = "Array ("; $pos = ")"; //$sub_arr = $pre.$sub_arr.$pos; return $sub_arr; } function format_date_db($date) { $dtary = explode("-",$date); //print_r($dtary); if (count($dtary)>1) { return $dtary[2]."-".$dtary[1]."-".$dtary[0]; } else { return($date); } } function format_date_db1($date) { $dtary = explode("-",$date); if (count($dtary)>0) { return $dtary[2]."-".$dtary[1]."-".$dtary[0]; } else { return($date); } } ?>