I have a multidimensional array stored in $t_comments
that looks something like this:
Array (
[0] => Array
(
[0] => 889
[1] => First comment
[2] => 8128912812
[3] => approved
)
[1] => Array
(
[0] => 201
[1] => This is the second comment
[2] => 333333
[3] => deleted
)
// There is more...
)
Currently, I loop through the array like this:
foreach($t_comments as $t_comment) {
echo $t_comment[0]; // id
echo $t_comment[1]; // comment
echo $t_comment[2]; // timestamp
echo $t_comment[3]; // status
}
I want to foreach loop through the array and only display arrays that have the value approved
(as seen above). How do I do this when having performance in consideration?