3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //Store your XML Request in a variable $input_xml = '<AvailRequest> <Trip>ONE</Trip> <Origin>BOM</Origin> <Destination>JFK</Destination> <DepartDate>2013-09-15</DepartDate> <ReturnDate>2013-09-16</ReturnDate> <AdultPax>1</AdultPax> <ChildPax>0</ChildPax> <InfantPax>0</InfantPax> <Currency>INR</Currency> <PreferredClass>E</PreferredClass> <Eticket>true</Eticket> <Clientid>777ClientID</Clientid> <Clientpassword>*Your API Password</Clientpassword> <Clienttype>ArzooINTLWS1.0</Clienttype> <PreferredAirline></PreferredAirline> </AvailRequest>'; //Now I've made a little changes in the above curl_setopt declaration as follows: $url = "http://59.162.33.102:9301/Avalability"; //setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // Following line is compulsary to add as it is: curl_setopt($ch, CURLOPT_POSTFIELDS, "xmlRequest=" . $input_xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300); $data = curl_exec($ch); curl_close($ch); //convert the XML result into array $array_data = json_decode(json_encode(simplexml_load_string($data)), true); print_r('<pre>'); print_r($array_data); print_r('</pre>'); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/Cd9Cf:26 Stack trace: #0 {main} thrown in /in/Cd9Cf on line 26
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<pre></pre>
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/Cd9Cf on line 26
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/Cd9Cf on line 26
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/Cd9Cf on line 26
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/Cd9Cf on line 26