title: parse into another array contain xml child node using php
body: <p>currently, im having problem to parse xml node in array using condition where parse with <code>&lt;mo&gt;</code> as separator</p>
  
  <p>this is my array(0)</p>
  
  <pre><code>Array([0] =&gt; &lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;);
  </code></pre>
  
  <p>i want to parse like this</p>
  
  <pre><code>Array[0] =&gt; &lt;mi&gt;x&lt;/mi&gt;
  Array[1] =&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;
  Array[2]=&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;
  </code></pre>
  
  <p>this is my coding</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?
  $result(0)="&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;";
  $result1= new simplexml_load_string($result);
  $arr_result=[];
  foreach($result1 as $key =&gt; $value){
       $exp_key = explode('&lt;', $key);
      if($key[0] == 'mo'){
           $arr_result[] = $value;
      }
  print_r($arr_result);
  }
  
  
  if(isset($arr_result)){
      print_r($arr_result);
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>thanks in advance !</p>