I get some random PHP arrays generated by a backend, and I want to loop in it, and ignore all entries where weight > 5000. Some array example:
array(4) {
[0]=>
object(stdClass)#72 (3) {
["weight"]=>
string(2) "80"
["added_date"]=>
string(19) "2016-10-02 11:49:27"
["etid"]=>
string(1) "3"
}
[1]=>
object(stdClass)#68 (3) {
["weight"]=>
string(4) "6760"
["added_date"]=>
string(19) "2016-10-04 14:30:25"
["etid"]=>
string(1) "3"
}
[2]=>
object(stdClass)#63 (3) {
["weight"]=>
string(4) "1360"
["added_date"]=>
string(19) "2016-10-04 14:56:21"
["etid"]=>
string(1) "3"
}
[3]=>
object(stdClass)#122 (3) {
["weight"]=>
string(4) "1040"
["added_date"]=>
string(19) "2016-10-25 16:52:25"
["etid"]=>
string(1) "3"
}
And my desired output will be:
array(1) {
[0]=>
object(stdClass)#72 (3) {
["weight"]=>
string(2) "6760"
["added_date"]=>
string(19) "2016-10-02 11:49:27"
["etid"]=>
string(1) "3"
}
How will look a PHP for loop to only filter the array values with weight >5000. Thank you.