url = $mr; } function set($key,$value){ $exists = false; $a = explode("?",$this->url); $patterns = explode("&", $a[1]); for($i=0; $iurl; } } function get($key){ $exists = false; $a = explode("?",$this->url); $patterns = explode("&", $a[1]); for($i=0; $iget("version"); if($version == "1.0.0"){ $output = $this->set("format","PNG"); return $output; } else{ $output = $this->set("format","image/png"); return $output; } } function getFormat(){ $format = $this->get("format"); if ($format=="PNG" || $format=="image/png"){ return "png"; } else if ($format=="JPEG" || $format=="image/jpeg"){ return "jpeg"; } else { return null; } } function setFormat($formatType){ $version = $this->get("version"); if($version == "1.0.0"){ if ($formatType=='png'){ $output = $this->set("format","PNG"); return $output; } else if ($formatType=='jpeg'){ $output = $this->set("format","JPEG"); return $output; } else { return; } } else{ if ($formatType=='png'){ $output = $this->set("format","image/png"); return $output; } else if ($formatType=='jpeg'){ $output = $this->set("format","image/jpeg"); return $output; } else { return; } } } function append($param){ $this->url .= "&".$param; $this->encodeGET(); return $this->url; } function remove($key){ $a = explode("?",$this->url); $patterns = explode("&", $a[1]); for($i=0; $iurl = preg_replace($currentPattern, $replacement, $this->url); } } $this->encodeGET(); return $this->url; } function encodeGET($encode = true){ $a = explode("?",$this->url); $patterns = explode("&", $a[1]); $a[0].= "?"; for($i=0; $iencodeParams)){ $val = explode(",", $tmp[1]); $a[0] .= $tmp[0]."="; for($ii=0; $ii0){$a[0].=",";} if($encode){ $a[0].= urlencode($val[$ii]); }else{ $a[0].= $val[$ii]; } } if ($i < (count($patterns)-1)) { $a[0] .= "&"; } } else{ $a[0] .= $tmp[0] . "=" .$tmp[1]; if ($i < (count($patterns)-1)) { $a[0] .= "&"; } } } $this->url = $a[0]; return $this->url; } function encodeLegGET(){ $this->url = preg_replace("/&/", "\&", $this->url); return $this->url; } } ?>