Hallo mnb,
Mit Deinen Functions habe ich mich heute nochmal in diversen Testläufen beschäftigt - funzt schon sehr gut
Es geht auch ein mischen von Foldern und Items. $MetaData habe ich dann gleich durch das Einfügen der gesamten DIDL-Lite mit implementiert.
Hier mein aktuelles Test-Skript:
<?
$xml = '<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result><DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">
<container id="A0$128$146$524565$22413589$22479125$192676117$192741653" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1" childCount="31"><dc:title>ATB Sunset Beach DJ Session</dc:title><upnp:class>object.container.storageFolder</upnp:class></container><container id="A0$128$146$524565$22413589$22479125$192676117$192807189" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1" childCount="26"><dc:title>Future Memories</dc:title><upnp:class>object.container.storageFolder</upnp:class></container><item id="A0$128$146$524565$22413589$22479125$192676117$571146500" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1"><dc:title>Right Back (Original Mix)</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:description>Amazon.com Song ID: 217023763</dc:description><dc:creator>Yuri Kane</dc:creator><dc:date>2014-07-20T16:21:15</dc:date><upnp:artist>Yuri Kane</upnp:artist><upnp:album>ATB Sunset Beach DJ Session</upnp:album><upnp:genre>Dance & DJ</upnp:genre><upnp:originalTrackNumber>2</upnp:originalTrackNumber><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" size="11797385" duration="00:05:56.00" bitrate="259000" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.178.10:8200/MediaItems/A0$128$146$524565$22413589$22479125$192676117$571146500.mp3?type=1,client=25,mime=audio/mpeg,pn=MP3</res></item><item id="A0$128$146$524565$22413589$22479125$192676117$571080964" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1"><dc:title>L.A. Nights</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:description>Amazon.com Song ID: 213174179</dc:description><dc:creator>ATB</dc:creator><dc:date>2014-07-20T16:21:13</dc:date><upnp:artist>ATB</upnp:artist><upnp:album>Future Memories</upnp:album><upnp:genre>Dance & DJ</upnp:genre><upnp:originalTrackNumber>1</upnp:originalTrackNumber><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" size="9074176" duration="00:04:32.00" bitrate="264000" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.178.10:8200/MediaItems/A0$128$146$524565$22413589$22479125$192676117$571080964.mp3?type=1,client=25,mime=audio/mpeg,pn=MP3</res><upnp:albumArtURI dlna:profileID="JPEG_TN" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">http://192.168.178.10:8200/Thumbnails/A01/share/CACHEDEV1_DATA/.system/music/atb%2ffuture+memories.jpg</upnp:albumArtURI></item><item id="A0$128$146$524565$22413589$22479125$192676117$571015428" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1"><dc:title>Could You Believe (Airplay Mix)</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:description>Amazon.com Song ID: 217023762</dc:description><dc:creator>ATB</dc:creator><dc:date>2014-07-20T16:21:11</dc:date><upnp:artist>ATB</upnp:artist><upnp:album>ATB Sunset Beach DJ Session</upnp:album><upnp:genre>Dance & DJ</upnp:genre><upnp:originalTrackNumber>1</upnp:originalTrackNumber><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" size="7360435" duration="00:03:29.00" bitrate="272000" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.178.10:8200/MediaItems/A0$128$146$524565$22413589$22479125$192676117$571015428.mp3?type=1,client=25,mime=audio/mpeg,pn=MP3</res><upnp:albumArtURI dlna:profileID="JPEG_TN" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">http://192.168.178.10:8200/Thumbnails/A01/share/CACHEDEV1_DATA/.system/music/atb%2fatb+sunset+beach+dj+session.jpg</upnp:albumArtURI></item><item id="A0$128$146$524565$22413589$22479125$192676117$571212036" parentID="A0$128$146$524565$22413589$22479125$192676117" restricted="1"><dc:title>What About Us</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:description>Amazon.com Song ID: 213174180</dc:description><dc:creator>ATB</dc:creator><dc:date>2014-07-20T16:21:16</dc:date><upnp:artist>ATB</upnp:artist><upnp:album>Future Memories</upnp:album><upnp:genre>Dance & DJ</upnp:genre><upnp:originalTrackNumber>2</upnp:originalTrackNumber><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" size="11756320" duration="00:05:35.00" bitrate="279000" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.178.10:8200/MediaItems/A0$128$146$524565$22413589$22479125$192676117$571212036.mp3?type=1,client=25,mime=audio/mpeg,pn=MP3</res><upnp:albumArtURI dlna:profileID="JPEG_TN" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">http://192.168.178.10:8200/Thumbnails/A01/share/CACHEDEV1_DATA/.system/music/atb%2ffuture+memories.jpg</upnp:albumArtURI></item></DIDL-Lite></Result>
<NumberReturned>6</NumberReturned>
<TotalMatches>6</TotalMatches>
<UpdateID>0</UpdateID></u:BrowseResponse></s:Body></s:Envelope>
';
$MetaData = simplexml_load_string($xml);
$MetaData = $MetaData->xpath("//Result");
$MetaData = (string) $MetaData[0];
//DIDL umwandeln
$DIDL = (xml2array($xml));
//print_r($DIDL);
//Array $Liste erstellen
$liste = BrowseList($DIDL, $MetaData);
print_r($liste);
//Functions---------------------------------------------------------------------
function xml2array($contents, $get_attributes=1, $priority = 'tag') {
if(!$contents) return array();
if(!function_exists('xml_parser_create')) {
//print "'xml_parser_create()' function not found!";
return array();
}
$contents = str_replace(array("<", ">", """, "&", "%3a", "%2f", "%25"), array("<", ">", "\"", "&", ":", "/", "%"), $contents);
//Get the XML parser of PHP - PHP must have this module for the parser to work
$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, trim($contents), $xml_values);
xml_parser_free($parser);
if(!$xml_values) return;//Hmm...
//Initializations
$xml_array = array();
$parents = array();
$opened_tags = array();
$arr = array();
$current = &$xml_array; //Refference
//Go through the tags.
$repeated_tag_index = array();//Multiple tags with same name will be turned into an array
foreach($xml_values as $data) {
unset($attributes,$value);//Remove existing values, or there will be trouble
//This command will extract these variables into the foreach scope
// tag(string), type(string), level(int), attributes(array).
extract($data);//We could use the array by itself, but this cooler.
$result = array();
$attributes_data = array();
if(isset($value)) {
if($priority == 'tag') $result = $value;
else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode
}
//Set the attributes too.
if(isset($attributes) and $get_attributes) {
foreach($attributes as $attr => $val) {
if($priority == 'tag') $attributes_data[$attr] = $val;
else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
}
}
//See tag status and do the needed.
if($type == "open") {//The starting of the tag '<tag>'
$parent[$level-1] = &$current;
if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag
$current[$tag] = $result;
if($attributes_data) $current[$tag. '_attr'] = $attributes_data;
$repeated_tag_index[$tag.'_'.$level] = 1;
$current = &$current[$tag];
} else { //There was another element with the same tag name
if(isset($current[$tag][0])) {//If there is a 0th element it is already an array
$current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
} else {//This section will make the value an array if multiple tags with the same name appear together
$current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array
if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well
$current[$tag]['0_attr'] = $current[$tag.'_attr'];
unset($current[$tag.'_attr']);
}
}
if($attributes_data) $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
$repeated_tag_index[$tag.'_'.$level]++;
$last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;
$current = &$current[$tag][$last_item_index];
}
} elseif($type == "complete") { //Tags that ends in 1 line '<tag/>'
// turn empty array to empty string
if (is_array($result) && empty($result)) {
$result = '';
}
//See if the key is already taken.
if(!isset($current[$tag])) { //New Key
$current[$tag] = $result;
$repeated_tag_index[$tag.'_'.$level] = 1;
if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;
} else { //If taken, put all things inside a list(array)
if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...
// ...push the new element into that array.
$current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
if($priority == 'tag' and $get_attributes and $attributes_data) {
$current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
}
$repeated_tag_index[$tag.'_'.$level]++;
} else { //If it is not an array...
$current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value
$repeated_tag_index[$tag.'_'.$level] = 1;
if($priority == 'tag' and $get_attributes) {
if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well
$current[$tag]['0_attr'] = $current[$tag.'_attr'];
unset($current[$tag.'_attr']);
}
if($attributes_data) {
$current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
}
}
$repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken
}
}
} elseif($type == 'close') { //End of tag '</tag>'
$current = &$parent[$level-1];
}
}
return($xml_array);
}
function array_search_key($array,$search, $first_key_only = 1 )
{
$key = preg_grep('/'.$search.'/', array_keys($array));
reset($key);
$first_key = key($key);
if (isset($first_key)){
if($first_key_only == 1)
return($key[$first_key]);
return($key);
}
return false;
}
function array_check($array,$key)
{
if (is_array ($array))
{
return (isset($array[$key]) || array_key_exists($key,$array));
}
return (false);
}
function BrowseList($array, $MetaData)
{
if(!$array) return array();
//zum testen
//$MetaData="blablabla";
//Suche der Result im Array
//sollte noch verbessert werden
$key = array_search_key($array, "Envelope$");
$key2 = array_search_key($array[$key], "Body$");
$key3 = array_search_key($array[$key][$key2], "BrowseResponse$");
$key4 = array_search_key($array[$key][$key2][$key3], "Result$");
$DIDL = $array[$key][$key2][$key3][$key4]["DIDL-Lite"];
$liste = array();
$i = 0;
if(array_check($DIDL,'container'))
{
$keys = array_search_key($DIDL['container'],"[0-9]$",0);
$count = count($keys);
if ($count==1){
$i=0;
$liste[$i]['typ'] = 'container';
$liste[$i]['metadata'] = $MetaData;
if(isset($DIDL['container_attr']['id']))
$liste[$i]['id'] = $DIDL['container_attr']['id'];
if(isset($DIDL['container_attr']['refID']))
$liste[$i]['refid'] = $DIDL['container_attr']['refID'];
if(isset($DIDL['container_attr']['parentID']))
$liste[$i]['parentid'] = $DIDL['container_attr']['parentID'];
if(isset($DIDL['container_attr']['restricted']))
$liste[$i]['restricted'] = $DIDL['container_attr']['restricted'];
$key = array_search_key($DIDL['container'],"artist$");
if($key)
$liste[$i]['artist'] = $DIDL['container'][$key];
$key = array_search_key($DIDL['container'],"album$");
if($key)
$liste[$i]['album'] = $DIDL['container'][$key];
$key = array_search_key($DIDL['container'],"title$");
if($key)
$liste[$i]['title'] = $DIDL['container'][$key];
}
else
{
for ($i=0; $i < $count; $i++)
{
$liste[$i]['typ'] = 'container';
$liste[$i]['metadata'] = $MetaData;
if(isset($DIDL['container'][$i."_attr"]['id']))
$liste[$i]['id'] = $DIDL['container'][$i."_attr"]['id'];
if(isset($DIDL['container'][$i."_attr"]['refID']))
$liste[$i]['refid'] = $DIDL['container'][$i."_attr"]['refID'];
if(isset($DIDL['container'][$i."_attr"]['parentID']))
$liste[$i]['parentid'] = $DIDL['container'][$i."_attr"]['parentID'];
if(isset($DIDL['container'][$i."_attr"]['restricted']))
$liste[$i]['restricted'] = $DIDL['container'][$i."_attr"]['restricted'];
$key = array_search_key($DIDL['container'][$i],"artist$");
if($key)
$liste[$i]['artist'] = $DIDL['container'][$i][$key];
$key = array_search_key($DIDL['container'][$i],"album$");
if($key)
$liste[$i]['album'] = $DIDL['container'][$i][$key];
$key = array_search_key($DIDL['container'][$i],"title$");
if($key)
$liste[$i]['title'] = $DIDL['container'][$i][$key];
}
}
}
if(array_check($DIDL,'item'))
{
$keys = array_search_key($DIDL['item'],"[0-9]$",0);
$count = (count($keys));
$n = $i;
if ($count==1){
$i=0;
$liste[$n+$i]['typ'] = 'item';
$liste[$n+$i]['metadata'] = $MetaData;
if(isset($DIDL['item_attr']['id']))
$liste[$n+$i]['id'] = $DIDL['item_attr']['id'];
if(isset($DIDL['item_attr']['refID']))
$liste[$n+$i]['refid'] = $DIDL['item_attr']['refID'];
if(isset($DIDL['item_attr']['parentID']))
$liste[$n+$i]['parentid'] = $DIDL['item_attr']['parentID'];
if(isset($DIDL['item_attr']['restricted']))
$liste[$n+$i]['restricted'] = $DIDL['item_attr']['restricted'];
$key = array_search_key($DIDL['item'],"artist$");
if($key){
if(array_check($DIDL['item'][$key],'0'))
$liste[$n+$i]['artist'] = $DIDL['item'][$key]['0'];
else
$liste[$n+$i]['artist'] = $DIDL['item'][$key];
}
$key = array_search_key($DIDL['item'],"album$");
if($key)
$liste[$n+$i]['album'] = $DIDL['item'][$key];
$key = array_search_key($DIDL['item'],"title$");
if($key)
$liste[$n+$i]['title'] = $DIDL['item'][$key];
if(array_check($DIDL['item']['res'],'0')){
//kann noch verbessert werden, da mehrere Recourcen zur Verfügung stehen
$liste[$n+$i]['resource'] = $DIDL['item']['res']['0'];
if(isset($DIDL['item']['res']['0_attr']['duration']))
$liste[$n+$i]['duration'] = $DIDL['item']['res']['0_attr']['duration'];
if(isset($DIDL['item']['res']['0_attr']['size']))
$liste[$n+$i]['size'] = $DIDL['item']['res']['0_attr']['size'];
if(isset($DIDL['item']['res']['0_attr']['bitrate']))
$liste[$n+$i]['bitrate'] = $DIDL['item']['res']['0_attr']['bitrate'];
}
else {
if(array_check($DIDL['item'],'res')){
$liste[$n+$i]['resource'] = $DIDL['item']['res'];
if(isset($DIDL['item']['res_attr']['duration']))
$liste[$n+$i]['duration'] = $DIDL['item']['res_attr']['duration'];
if(isset($DIDL['item']['res_attr']['size']))
$liste[$n+$i]['size'] = $DIDL['item']['res_attr']['size'];
if(isset($DIDL['item']['res_attr']['bitrate']))
$liste[$n+$i]['bitrate'] = $DIDL['item']['res_attr']['bitrate'];
}
}
$key = array_search_key($DIDL['item'],"albumArtURI$");
if($key)
$liste[$n+$i]['albumArtURI'] = $DIDL['item'][$key];
$key = array_search_key($DIDL['item'],"genre$");
if($key)
$liste[$n+$i]['genre'] = $DIDL['item'][$key];
$key = array_search_key($DIDL['item'],"date$");
if($key)
$liste[$n+$i]['date'] = $DIDL['item'][$key];
$key = array_search_key($DIDL['item'],"originalTrackNumber$");
if($key)
$liste[$n+$i]['originalTrackNumber'] = $DIDL['item'][$key];
$key = array_search_key($DIDL['item'],"class$");
if($key)
$liste[$n+$i]['class'] = $DIDL['item'][$key];
}
else
{
for ($i=0; $i < $count; $i++)
{
$liste[$n+$i]['typ'] = 'item';
$liste[$n+$i]['metadata'] = $MetaData;
if(isset($DIDL['item'][$i.'_attr']['id']))
$liste[$n+$i]['id'] = $DIDL['item'][$i.'_attr']['id'];
if(isset($DIDL['item'][$i.'_attr']['refID']))
$liste[$n+$i]['refid'] = $DIDL['item'][$i.'_attr']['refID'];
if(isset($DIDL['item'][$i.'_attr']['parentID']))
$liste[$n+$i]['parentid'] = $DIDL['item'][$i.'_attr']['parentID'];
if(isset($DIDL['item'][$i.'_attr']['restricted']))
$liste[$n+$i]['restricted'] = $DIDL['item'][$i.'_attr']['restricted'];
$key = array_search_key($DIDL['item'][$i],"artist$");
if($key){
if(array_check($DIDL['item'][$i][$key],'0'))
$liste[$n+$i]['artist'] = $DIDL['item'][$i][$key]['0'];
else
$liste[$n+$i]['artist'] = $DIDL['item'][$i][$key];
}
$key = array_search_key($DIDL['item'][$i],"album$");
if($key)
$liste[$n+$i]['album'] = $DIDL['item'][$i][$key];
$key = array_search_key($DIDL['item'][$i],"title$");
if($key)
$liste[$n+$i]['title'] = $DIDL['item'][$i][$key];
if(array_check($DIDL['item'][$i]['res'],'0')){
//kann noch verbessert werden, da mehrere Recourcen zur Verfügung stehen
$liste[$n+$i]['resource'] = $DIDL['item'][$i]['res']['0'];
if(isset($DIDL['item'][$i]['res']['0_attr']['duration']))
$liste[$n+$i]['duration'] = $DIDL['item'][$i]['res']['0_attr']['duration'];
if(isset($DIDL['item'][$i]['res']['0_attr']['size']))
$liste[$n+$i]['size'] = $DIDL['item'][$i]['res']['0_attr']['size'];
if(isset($DIDL['item'][$i]['res']['0_attr']['bitrate']))
$liste[$n+$i]['bitrate'] = $DIDL['item'][$i]['res']['0_attr']['bitrate'];
}
else {
if(array_check($DIDL['item'][$i],'res')){
$liste[$n+$i]['resource'] = $DIDL['item'][$i]['res'];
if(isset($DIDL['item'][$i]['res_attr']['duration']))
$liste[$n+$i]['duration'] = $DIDL['item'][$i]['res_attr']['duration'];
if(isset($DIDL['item'][$i]['res_attr']['size']))
$liste[$n+$i]['size'] = $DIDL['item'][$i]['res_attr']['size'];
if(isset($DIDL['item'][$i]['res_attr']['bitrate']))
$liste[$n+$i]['bitrate'] = $DIDL['item'][$i]['res_attr']['bitrate'];
}
}
$key = array_search_key($DIDL['item'][$i],"albumArtURI$");
if($key)
$liste[$n+$i]['albumArtURI'] = $DIDL['item'][$i][$key];
$key = array_search_key($DIDL['item'][$i],"genre$");
if($key)
$liste[$n+$i]['genre'] = $DIDL['item'][$i][$key];
$key = array_search_key($DIDL['item'][$i],"date$");
if($key)
$liste[$n+$i]['date'] = $DIDL['item'][$i][$key];
$key = array_search_key($DIDL['item'][$i],"originalTrackNumber$");
if($key)
$liste[$n+$i]['originalTrackNumber'] = $DIDL['item'][$i][$key];
$key = array_search_key($DIDL['item'][$i],"class$");
if($key)
$liste[$n+$i]['class'] = $DIDL['item'][$i][$key];
}
}
}
return ($liste);
}
?>
Was wir dazu noch brauchen:
das Array sollte immer die gleiche Struktur (Anzahl der Keys) haben, da der Zugriff später teils so als Entscheidungsbaum geschieht:
if (($liste[$i]['artist']) == "leer")
Wenn also eine Information nicht vorhanden ist sollte hier z.B. [Artist] → „leer“ im Array stehen.
Ich habe endlich auch die Lösung für das xpath-Problem
$MetaData = simplexml_load_string($xml);
$MetaData = $MetaData->xpath("//Result");
$MetaData = (string) $MetaData[0];
Kennt aber jemand einen Ersatz für http_chunked_decode($string), da ja die php_http - Extension offenbar nicht mehr erhältlich ist ab PHP 5.4 ?
Nötig wäre das für Server, welche ihre Daten chunked übertragen wie die Fritzbox (siehe auch Post #7 von fschut2001, als ich über die Zeichenketten dazwischen ins Grübeln kam). Soweit ich rechrchieren konnte, gibt es Server, die die Antwort als einen String übertragen, aber auch andere, die aufgrund einer problematischen Größe die Antwort gleich zerteilt (zu erkennen an: Transfer-Encoding: chunked senden. Die Länge der einzelnen Strings wird dann Zeile für Zeile mitgegeben. Gedacht hatte ich schon an ein „Herausschneiden“ anhand der Zeilenumbrüche.
An diesen Strings beißt sich dann SimpleXML natürlich die Zähne aus. Deshalb habe ich auch zunächst den Explode-Weg gewählt um dieses Problem zu umgehen. Gut wäre aber ein Funktion die das ebenfalls macht, wie laut Recherche http_chunked_decode. Ich habe mir aber die Zähne ausgebissen diese php_http Extension zum Laufen zu bringen.
Gruß
André