title: Array returning [Object object] instead of value?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7620953/json-returning-object-object-instead-of-array">Json Returning [object object] instead of array</a>  </p>
  </blockquote>
  
  
  
  <p>I have an array that contains a sub-array, being pulled via a POST request to a PHP file. The thing is, I am having a hard time finding how to return the value of the array objects, let alone iterate through it.</p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'php.php',
      data: 'id=testdata',
      dataType: 'json',
      cache: false,
      success: function(result) {
          alert(result[0]); // returns [Object object]
      },
  });
  </code></pre>
  
  <p>I am sure that it is properly grabbing the array from the PHP file.</p>
  
  <p>Here's <a href="http://adventurelobbies.com/php.php" rel="nofollow noreferrer">the PHP file</a>.</p>