How can I check if there is a string "2017-11-15" in this array?
array(4) {
[0]=>
object(stdClass)#43 (1) {
["date"]=>
string(10) "2017-11-13"
}
[1]=>
object(stdClass)#44 (1) {
["date"]=>
string(10) "2017-11-14"
}
[2]=>
object(stdClass)#45 (1) {
["date"]=>
string(10) "2017-11-15"
}
[3]=>
object(stdClass)#46 (1) {
["date"]=>
string(10) "2017-11-16"
}
}
I tried this and could not:
$string = "2017-11-15";
if(in_array($string, (array) $proposal_dates)){
echo 'existe no array.';
} else{
echo 'nao existe no array';
}