3v4l.org

run code in 300+ PHP versions simultaneously
<?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.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.3.11, 4.4.0 - 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

preferences:
333.72 ms | 401 KiB | 456 Q