<?php $words_array = ['apple', 'and', 'tree']; $words = ['apples', 'apple', 'tree', 'plum']; $divOneFlag = FALSE; if (! empty($words)) { foreach ($words as $word) { if (in_array($word, $words_array)) { $divOneFlag = TRUE; } } } if ($divOneFlag) { echo 'div1'; } else { echo 'div2'; }
You have javascript disabled. You will not be able to edit any code.