loadHTML($html); @$dom->loadHTML(mb_convert_encoding(@$html, 'HTML-ENTITIES', 'UTF-8')); return element_to_obj($dom->documentElement); } function element_to_obj($element) { @$obj = array( "tag" => @$element->tagName ); foreach (@$element->attributes as $attribute) { $obj[$attribute->name] = $attribute->value; } foreach ($element->childNodes as $subElement) { if ($subElement->nodeType == XML_TEXT_NODE) { $obj["html"] = $subElement->wholeText; } else { $obj["children"][] = element_to_obj($subElement); } } return $obj; } function generate_password($number) {$arr = array('a','b','c','d','e','f', 'g','h','i','j','k','l','m','n','o','p','r','s','t','u','v','x','y','z','1','2','3','4','5','6','7','8','9','0'); $pass = ""; for($i = 0; $i < $number; $i++){ $index = rand(0, count($arr) - 1); $pass .= $arr[$index];} return $pass;} $a=file_get_contents('nix.xml'); #print_r(html_to_obj($a['children'][0]['children'][0])); 337854 $b=html_to_obj($a); //print_r($b['children'][0]['children'][0]['children'][0]['children'][5]['children']); $tovar_massiv=$b['children'][0]['children'][0]['children'][0]['children'][5]['children']; for ($i=0; $i