Sorry if this question is worded incorrectly or doesn't make any sense. What I am trying to do is write an if statement that checks if:
array(6) {
[5]=>
string(17) "Quality Assurance"
[6]=>
string(7) "Analyst"
[7]=>
string(19) "Developer/Front end"
[8]=>
string(18) "Developer/Back end"
[9]=>
string(4) "Test"
[10]=>
string(2) "hi"
}
Any of those keys, in this case, 5, 6, 7, 8, 9, 10 is in:
array(4) {
[0]=>
object(stdClass)#195 (2) {
["labour_type_id"]=>
int(5)
["required_labour_type_hours"]=>
int(40)
}
[1]=>
object(stdClass)#193 (2) {
["labour_type_id"]=>
int(6)
["required_labour_type_hours"]=>
int(80)
}
}
This second arrays "labour_type_id".
In this example, 5 and 6 would match.
I am trying to use the in_array() function but I am not sure how to access the labour_type_id of the second array.
My best attempt at the moment:
@foreach($labourTypes as $id => $name)
@if(in_array($id, $reqLabourTypes->labour_type_id))
Where labourTypes is the first array, and reqLabourTypes is the 2nd array.
Thanks.