add clear
This commit is contained in:
+4
-1
@@ -32,6 +32,9 @@ class Help extends Miniprogarampage
|
||||
*/
|
||||
public static function toArray($xml)
|
||||
{
|
||||
if (is_array($xml)) {
|
||||
return $xml;
|
||||
}
|
||||
if (!is_null($json = json_decode($xml, TRUE))) {
|
||||
return $json;
|
||||
}
|
||||
@@ -39,7 +42,7 @@ class Help extends Miniprogarampage
|
||||
return $json;
|
||||
}
|
||||
$data = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
if(is_array($data)){
|
||||
if (is_array($data)) {
|
||||
return $data;
|
||||
}
|
||||
return json_decode(json_encode($data), TRUE);
|
||||
|
||||
Reference in New Issue
Block a user