PHP array minor problem

Posted by Sennheiser on Stack Overflow See other posts from Stack Overflow or by Sennheiser
Published on 2011-02-18T07:06:46Z Indexed on 2011/02/18 7:25 UTC
Read the original article Hit count: 123

Filed under:
|

I'm really not sure how to explain this. It's so simple I can't fathom why it's not working.

I have a loop. It puts a bunch of strings into an array. If I fill a single variable with any given string, it will output it perfectly.

But filling an array with the strings will make it give me the dreaded:

Array Array Array Array Array Array Array Array

Note: my strings are not all 'Array'.

The way I loop is:

 while(...)
 {
     $arr[] = $resultFromLoop;
 }

Here is my var_dump.

    array(1) {
      ["tagName"]=>
      string(5) "magic"
    }
    array(1) {
      ["tagName"]=>
      string(4) "nunu"
    }
    array(1) {
      ["tagName"]=>
      string(5) "books"
    }
    array(1) {
      ["tagName"]=>
      string(0) ""
    }
    array(1) {
      ["tagName"]=>
      string(3) "zzz"
    }
    array(1) {
      ["tagName"]=>
      string(4) "grey"
    }
    array(1) {
      ["tagName"]=>
      string(3) "new"
    }
    array(1) {
      ["tagName"]=>
      string(6) "flight"
    }

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays