title: sum of the integer in nested array in php
body: <pre><code>    &lt;?php
      $r1=array("n"=&gt;3,"ni"=&gt;2,["nis"=&gt;3,[["nish"=&gt;4],[["nishi"=&gt;"n"],[["nishi"=&gt;true]]]]]);
      echo "&lt;pre&gt;";
      //print_r($r1);
      echo "&lt;/pre&gt;";
      $sum=0;
  
      for ($i=0;$i&lt;count($r1);$i++) {
      $curr=$r1[$i];
      if (is_array($curr)) {
                  $sum += array_sum($curr);
              } else if (is_numeric($curr)) {
                  $sum += $curr;
              }
              echo $sum;
      }
  ?&gt;
  </code></pre>
  
  <p>i am trying to find the the sum of the values in the array and leave the string . if anyone knows the answer plz help  </p>