/** * xml2Array * * parses DOM XML into an associative array * * @since version 1.8.0 * @access public */ function xml2Array($node, $attributes = false) { $return = array(); //loop over child nodes foreach ($node->childNodes as $node_child) { //does this child node have children? if ($node_child->hasChildNodes()) { //yes! child node has children //is this a collection of likely named nodes? if ($node->firstChild->nodeName == $node->lastChild->nodeName && $node->childNodes->length > 1) { //yes. add parsed xml as an element of the child node array $return[$node_child->nodeName][] = DJB::xml2array($node_child); } else { //no, the child nodes are named differently $return[$node_child->nodeName] = DJB::xml2array($node_child); } //end else } else { //no children. This is a leaf $return = $node_child->nodeValue; } //end else } //end foreach return $return; }
public function data() { $sql = "\n\t\t\tSELECT optionname post_title,\n optionid legacy_id\n\t\t\t FROM options\n\t\t\t WHERE optionlistid = 6\n\t\t\t ORDER BY optionname\n\t\t"; $data = \DJB::db('olddjb')->GetAll($sql); return $data; }
public function data() { $sql = "\n\t\t\tSELECT name post_title,\n\t\t\t\t\t\t abbr,\n\t\t\t\t\t\t sort_order,\n\t\t\t\t\t\t ordr the_order,\n\t\t\t\t\t\t saberpoints saber_points,\n\t\t\t\t\t\t handtohandpoints hand_to_hand_points,\n\t\t\t\t\t\t forcepoints force_points,\n\t\t\t\t\t\t skillpoints skill_points,\n\t\t\t\t\t\t disciplinepoints discipline_points,\n\t\t\t\t\t\t rank_id legacy_id\n\t\t\t FROM ranks\n\t\t\t ORDER BY sort_order\n\t\t"; $data = \DJB::db('olddjb')->GetAll($sql); return $data; }