Moin Liebe leute
Ich habe mal wieder ein Problem in PHP, ich möchte ein Array in Variablen umwandeln bsp:
Ausgabe des Arrays
PHP-Code:
Array
(
[success] => 1
[client] => Array
(
[id] => 20
[email] => demo
[password] => demo
[lastlogin] => demo
[ip] => demo
[host] => v
[status] => Active
[parent_id] => 0
[firstname] => demo
[lastname] => demo
[companyname] =>
[address1] => demo
[address2] =>
[city] => demo
[state] => demo
[postcode] => demo
[country] => DE
[phonenumber] => demo
[datecreated] => demo
[notes] =>
[language] => german
[company] => 0
[credit] => 0.00
[taxexempt] => 0
[latefeeoveride] => 0
[cardtype] => demo
[cardnum] =>
[expdate] =>
[overideduenotices] => 0
[client_id] => 20
[currency_id] => 0
[geburtsdatum] =>
[countryname] => Germany
)
[call] => getClientDetails
[server_time] => 1331232576
)
Ich habe es mit einer schleife versucht, mein verständnis begreift es leider nicht, bitte um hilfe
PHP-Code:
<?php
$url = 'demo';
$post = array(
'api_id' => 'demo',
'api_key' => 'demo',
'call' => 'getClientDetails',
'id'=>40
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
$return = json_decode($data, true);
print_r($return);
?>
Ich danke um mithilfe. lg