标签:turn 通信 pos div mod item return value public
xml方式封装通信数据方法
public static function xmlToEncode($data) { $xml = ""; foreach($data as $key => $value) { $attr = ""; if(is_numeric($key)) { $attr = " id=‘{$key}‘"; $key = "item"; } $xml .= "<{$key}{$attr}>"; $xml .= is_array($value) ?self::xmlToEncode($value) : $value; $xml .= "</{$key}>\n"; } return $xml; }
标签:turn 通信 pos div mod item return value public
原文地址:http://www.cnblogs.com/blfbuaa/p/6930638.html