0

Hello i have array as

Array
(
    [1] => Fedora
    [6] => Array
        (
            [0] => Android
            [1] => Selenium
        )

    [200] => Array
        (
            [0] => hi there
            [1] => New
        )
)

how to print this in php using for loop because using normal forloop it says no index for array[0].
i have chnaged array keys.

Edited by Priti_P

1
Contributor
1
Reply
7
Views
3 Years
Discussion Span
Last Post by Priti_P
1

so sorry,
it was simple:

foreach ($array as $key => $value) 
   {
      if (is_array($value))
     {
         foreach($value as $test)
            echo($test)."<br>";
     }
      else
        {
            echo($value);
            echo "<br><br>";
        }
   }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.