일치하는 값이 있으면 true를 출력하고 array_intersect 함수를 생각하면됩니까? 매우 확실하지 않다! 어떤 도움을 많이 주시면 감사하겠습니다!두 배열의 값을 일치 시키려고하면 일치하는 값이있는 경우 true를 출력하고 두 배열의 값을 일치 시키려고하면
기본적으로이 상자에 들어갈 수없는 두 가지 sql 쿼리가 있습니다! 하지만 그들은 $ staffExpertise 및 $ moduleExpertise 배열을 반환하지만, PHP는 매우 익숙하지 않으며, 배열의 교차 함수에 익숙하지 않으므로 여기에서 무엇을 해야할지 너무 확신하지 못합니다! 시도
foreach ($results as $row) {
$staffExpertise = $row['expertise'];
}
foreach ($results as $row) {
$moduleExpertise = $row['expertise'];
}
$arrayIntersection = array_intersect($moduleExpertise, $staffExpertise);
if($arrayIntersection =){
}
기본적으로 내가이 상자에 매우 적합 기운이 SQL 쿼리를 가지고! 하지만 그들은 $ staffExpertise 및 $ moduleExpertise 배열을 반환하지만, PHP는 매우 익숙하지 않으며, 배열의 교차 함수에 익숙하지 않으므로 여기에서 무엇을 해야할지 너무 확신하지 못합니다! foreach ($ 결과를 $ 행) { $ staffExpertise = $ row [ '전문 기술']; } foreach ($ results as $ row) { $ moduleExpertise = $ row [ 'expertise']; } $ arrayIntersection = array_intersect ($ moduleExpertise, $ staffExpertise); if ($ arrayIntersection =) { } –
@FindlayMack 질문을 올바른 형식으로 업데이트하십시오. –
시도한 코드 중 일부를 표시하거나 도움을 드릴 수 없습니다. – DrinkJavaCodeJava