I want to use PHP only, no jquery to include a page if a div contains the word YES. The reason for this is so that I can use CMS to change the content inside a div from YES to NO to include a page or not. I have tried preg_match, but it searches either a variable or exact phrase in the PHP itself. This is what I am looking for:
<div id="available">YES</div>
<?php if (preg_match("/YES/i", ID="available")) {
include 'page.php';
} else {
echo "Not Available.";
}
?>
I need the ID="available" to search the div id="available" and if YES is found, include the page, if not, echo "Not Available." Thanks for any help.