Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function send($header = NULL, $data = NULL, $method = NULL)
- {
- $urlRequest = $this->server;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $urlRequest);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- if (!is_null($header)) {
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- }
- if (!is_null($method)) {
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));
- }
- if (is_array($data)) {
- curl_setopt($ch, CURLOPT_POSTFIELDS, "xmlRequest=" . $data);
- }
- $output = curl_exec($ch);
- curl_close($ch);
- $xml = new SimpleXMLElement(json_decode($output, true));
- return $xml;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement