- array_intersect: documentation ( source)
- str_word_count: documentation ( source)
<?php
$sentence = "This is a red apple";
$words = array('red','apple');
$counts = array_intersect(str_word_count($sentence,1),$words);
if(count($counts) == count($words)){
echo "Yes";
}