1
I have the following data coming from a bank:
array(2) {
[0]=>
object(stdClass)#28 (6) {
["id"]=>
string(1) "5"
["user"]=>
string(2) "26"
["created_date"]=>
string(19) "2017-09-29 13:53:38"
["first_name"]=>
string(8) "Gabriela"
["last_name"]=>
string(5) "Silva"
["comment"]=>
string(39) "esse é o comentario para o eeo"
}
[1]=>
object(stdClass)#29 (6) {
["id"]=>
string(1) "1"
["user"]=>
string(1) "1"
["created_date"]=>
string(19) "2017-09-29 00:00:00"
["first_name"]=>
string(8) "Vinicius"
["last_name"]=>
string(6) "Aquino"
["comment"]=>
string(13) "helloooooooo!"
}
}
How can I check whether the "user" 26 exists on that array?
Can use a
forech
or some function ofarray_
– rray
I thought about using foreach, but I wonder if there is another option, as you cited an array function, I tested the in_array and it did not work very well
– viniciussvl
If there’s a value what you’ll do with it?
– rray
Hide a form.
– viniciussvl