note 89430 deleted from function.simplexml-load-string by cmb
| From: | cmb@php.net | Date: | Sun, 15 Dec 2019 10:08:30 +0000 |
| Subject: | note 89430 deleted from function.simplexml-load-string by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213522@lists.php.net to get a copy of this message | ||
Note Submitter: supzero at phparts dot net
----
if we don't know children number. How many loop. How many key.
<?php
class XML {
protected $pointer;
public $degerler=array();
function loadString($string){
$this->pointer = simplexml_load_string($string);
return $this->pointer;
}
function loadFile($file){
$this->pointer = simplexml_load_file($file);
return $this->pointer;
}
function getname(){
return $this->pointer->getName();
}
function child(){
return $this->pointer->children();
}
function att(){
return $this->pointer->attributes();
}
function toArray(){
foreach ($this->child() as $sq){
$this->degerler[$this->getname()][$sq->getname()][][] = $sq; // How many key
}
return;
}
}
?>