Grüßt euch,
ich möchte einen Wert aus dem array auslesen:
PHP-Code:
function xml_to_array($xml,$main_heading = '') {
$deXml = simplexml_load_string($xml);
$deJson = json_encode($deXml);
$xml_array = json_decode($deJson,TRUE);
if (! empty($main_heading)) {
$returned = $xml_array[$main_heading];
return $returned;
} else {
return $xml_array;
}
}
function fileCryptCcFolder($foldername){
global $och_links;
$links = array($och_links);
// POST DATA
$postdata = array(
'api_key' => 'XXXX',
'fn' => 'container',
'sub' => 'create',
'fmt' => 'xml',
'foldername' => $foldername,
'captcha' => '1',
'allow_container' => '1',
'allow_links' => '1',
'mirror[]' => implode("\n", $links)
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.filecrypt.cc/api.php");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);//Setting post data as xml
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$filecrypt_links = curl_exec($curl);
curl_close($curl);
$xml = $filecrypt_links;
$data_array = xml_to_array($xml);
var_dump($data_array);
return $data_array;
}
var_dump gibt mir folgendes Zurück:
array(2) { ["container"]=> array(4) { ["link"]=> string(50) "https://www.filecrypt.cc/Container/F60A0236A6.html" ["foldername"]=> string(5) "VCXcc" ["smallimg"]=> string(40) "https://www.filecrypt.cc/Stat/D5F75D5772" ["bigimg"]=> string(44) "https://www.filecrypt.cc/Stat/XXL/97938BDB5F" } ["state"]=> string(1) "1" }
Ich brauche lediglich folgende Ausgabe:
PHP-Code:
Link > https://www.filecrypt.cc/Container/F60A0236A6.html
Ich scheitere, jemand einen Tipp ?
LG