document.write(''); document.write(''); document.write(''); document.write(''); document.write('Paste provided by Paste.ee - View Original - View Raw - Download
'); document.write('
\<\?php 
\n
\nclass PastebinApi {
\n
\n	var $key;
\n	
\n	public function __construct($key="public") {
\n		$this->key = $key;
\n	}
\n	
\n	public function paste($paste, $description="", $language="plain", $format="json") {
\n		if(function_exists(\'curl_init\')) {
\n			$ch = curl_init(); 
\n			curl_setopt($ch, CURLOPT_URL, "http://paste.ee/api");
\n			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
\n			curl_setopt($ch, CURLOPT_POST, true); 
\n			curl_setopt($ch, CURLOPT_HTTPHEADER, array("Expect:")); 
\n			curl_setopt($ch, CURLOPT_HEADER, false); 
\n			curl_setopt($ch, CURLOPT_POSTFIELDS, array("key" => $this->key, "format" => $format, "language" => $language, "description" => $description, "paste" => $paste)); 
\n			
\n			$response = curl_exec($ch);
\n			
\n			curl_close($ch);
\n			
\n			switch($format) {
\n				case "json":
\n					return json_decode($response, true);
\n				case "simple":
\n					return $response;
\n			}
\n			return $response;
\n		} else {
\n			error_log("You need cURL to use this api!");
\n		}
\n	}
\n	
\n}
\n?>
'); function initEmbeddedPaste_OLDUWb2NfcO2xctq() { hljs.highlightBlock(document.getElementById('pastee-OLDUWb2NfcO2xctq-content')); } addEventListener('DOMContentLoaded', initEmbeddedPaste_OLDUWb2NfcO2xctq, false); addEventListener('load', initEmbeddedPaste_OLDUWb2NfcO2xctq, false);