note 111378 deleted from curl.examples-basic by danbrown
| From: | danbrown@php.net | Date: | Tue, 05 Mar 2013 16:05:09 +0000 |
| Subject: | note 111378 deleted from curl.examples-basic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193907@lists.php.net to get a copy of this message | ||
Note Submitter: Amit Dnyandeo Kadam
----
<?php
$url = 'localhost:10081/ZendServer/res.php';
$data = array("first_name" => "First name","last_name" =>
"last name","email"=>"email@gmail.com","addresses" =>
json_encode(array ("address1" => "some address" ,"city" =>
"city","country" => "CA", "first_name" =>
"Mother","last_name" => "Lastnameson","phone" =>
"555-1212", "province" => "ON", "zip" => "123
ABC" ) ) );
$ch=curl_init($url);
$data_string = json_encode($data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array("customer"=>$data_string));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>