Array (
[0] => Array ([username] => khaled [0] => khaled)
[1] => Array ([username] => Nariman [0] => Nariman)
[2] => Array ([username] => test1 [0] => test1)
[3] => Array ([username] => jack [0] => jack)
[4] => Array ([username] => mmmm [0] => mmmm)
[5] => Array ([username] => qqq [0] => qqq)
[6] => Array ([username] => wwwdwd [0] => wwwdwd)
[7] => Array ([username] => wddww [0] => wddww)
[8] => Array ([username] => maxa [0] => maxa)
)
I tried $posts['username'][0]/[0]['username'] ... didnt work!
I want to print out some values of the array, like the username for example. How to do it?
$posts[ $i ]['username']instead where $i is the index of the array inside the initial array.$posts['username'][0]doesn't exist. I'd suggest you read more, like in the PHP docs before moving on.