title: php json_decode
body: <p>Test in some json code, like <code>[{"a":"1"},{"a":"2"},{"a":"3"},{"b":"2"}]</code>, I want use json decode, get the data and make a judge, if first <code>a</code> nod is <code>==</code> <code>b</code> nod <em>or</em> fisrt <code>a</code> nod is <code>!=</code> <code>b</code> nod. some code here.</p>
  
  <pre><code>&lt;?php
  header("Content-type: text/html; charset=utf-8");
  $json = json_decode('[{"a":"1"},{"a":"2"},{"a":"3"},{"b":"2"}]',true);
  $number=1;
  foreach($json as $num){
  if($num['a']!=$num['b']){
      if($num['a']){
          echo 'a'.$number.''.$num['a'].'&lt;br /&gt;'; 
      }
  }else{
      if($num['a']){
          echo 'b'.$number.''.$num['a'].'&lt;br /&gt;'; 
      }
  }
  $number++;
  }
  ?&gt;
  </code></pre>
  
  <p>Now my result is:</p>
  
  <pre><code>a11 
  a22 
  a33
  </code></pre>
  
  <p>And I need get the result:</p>
  
  <pre><code>a11
  b22
  a33
  </code></pre>