title: How to work with jQuery AJAX and PHP array return
body: <p>I have a jquery ajax request like;</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'processor.php',
      data: 'data1=testdata1&amp;data2=testdata2&amp;data3=testdata3',
      cache: false,
      success: function(result) {
        if(result){
          alert(result);
        }else{
          alert("error");
        }
      }
  });
  </code></pre>
  
  <p>The handler <code>processor.php</code> is set to return an array like;</p>
  
  <pre><code>$array = array("a","b","c","d");
  echo $array;
  </code></pre>
  
  <p>I want to do action in client side based on this. Say if array[0] is 'b', I want to alert "hi". Again if array[2] is 'x', I want to alert "hello", and so on. How can I filter array elements in order to grab their data?</p>