"moo", "spam" => "eggs" } */ $cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit class BDictionary { private function __construct(){ } /** * Returns the decoded array from $str * @throws an IllegalArgumentException in the case * that the string is malformed. */ public static function toArray($str){ if (substr($str, 0, 1)!="d" || substr($str, -1, 1)!="e") throw new IllegalArgumentException("BEncoded dictionary does not start with d or end with e."); // An array is simply two lists encoded in an alternating list $arrays = BList::toList("l".substr($str, 1)); $i=0; for ($i=0;$i $value){ $list[] = $key; $list[] = $value; } return "d".substr(BList::toEncoded($list), 1); } } ?>