$data = (array) simplexml_load_string($string, 'SimpleXMLElement', LIBXML_NOCDATA); $data = array_map('self::parseInnerXml', $data); return $data;and parsing method:
protected static function parseInnerXml($obj) { if($obj instanceof SimpleXMLElement) return (array) $obj; return $obj; }
if ($structure == NULL) { $structure = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><$basenode />"); }Okay, but what if $structure is not a null? Well, that's the point. Error.
if (is_null($structure)) $structure = "<?xml version='1.0' encoding='utf-8'?>"; $structure = simplexml_load_string("$structure<$basenode />");
public static function camelize($underscored_word) { return preg_replace('/(^|_)(.)/e', "strtoupper('\\1\\2')", strval($underscored_word)); }will never return a CamelCased string as it returns Almost_Camel_Cased string. Fix:
return preg_replace('/(^|_)(.)/e', "strtoupper('\\2')", strval($underscored_word));
It looks like you're new here. If you want to get involved, click one of these buttons!