3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pixel { public $orderDateTime; public $domain; public $publId; public $privId; } class PixelHandling extends SoapClient{ // Client connection private $client_options = array('login' => 'SlevogtE', 'password' => 'BBDEXI', 'trace' => 1); private $wsdl; private $client; function __construct(){ $this->wsdl = 'https://' . $client_options['login'] . ':' . $client_options['password'] . '@tom-test.vgwort.de/services/1.0/pixelService.wsdl' ; $this->client = new SoapClient($wsdl, $client_options); } // Order Pixel (amount) --> pixels will be written to array $pixels public function orderNewPixel($amount){ $params = new StdClass(); $params->count = $amount; $arr = array(); try{ $result = $this->client->orderPixel($params); foreach($result as $val){ $pixels = new Pixel(); $pixels->orderDateTime = $val->orderDateTime; $pixels->domain = $val->domain; $pixels->publId = $val->pixels->publicIdentificationId; $pixels->privId = $val->pixels->privateIdentificationId; array_push($arr, $pixels); } } catch(SoapFault $e){ echo "Fehlercode: ", $result->errorcode, "\n"; echo "Message: ", $result->errormsg, "\n"; echo "Folgende Anzahl waere moeglich gewesen: ", $result->maxOrder, "\n"; } return $arr; } } // Check whether Soap can be even used.. if(!class_exists('SoapClient')){ echo '<script type="text/javascript" language="Javascript">alert("Fehler: PHP-Modul fehlt.")</script>'; } $test = new PixelHandling(); $test->orderNewPixel(2); // Format für Pixel export // <IMG src="domain.met.vgwort.de/na/c5b7568d28884052a9ff92d5afd08f34" // height="1" width="1" border=“0“> ?>

preferences:
39.72 ms | 402 KiB | 5 Q