I am trying to change the output on something when a category ID equals a specific number. For some reason this always returns false. What am I missing?
<?php
$ad_id = '#_CATEGORYID';
$id = 55;
if ($ad_id === $id ) {
echo 'true';
} else {
echo 'false';
}
?>
EDIT Sorry should have clarified, #_CATEGORYID is a shortcode from another application that returns integers. When echo $ad_id
the value returned is 55.
It sounds to me like you may need to eval your third-party markup before the comparison.
<?php
eval("\$ad_id = '#_CATEGORYID'");
$id = "55";
if ($ad_id === $id ) {
echo 'true';
} else {
echo 'false';
}
?>