I am trying to match two strings and if there is a match state that a match was found. The strings I am comparing are dates using the following code.
$feed = simplexml_load_file('http://feeds.feedburner.com/2dopeboyz');
foreach($feed->channel->item as $item) {
$title = $item->title;
$description = $item->description;
$pubdate = $item->pubDate;
$newDate = date("mdY", strtotime(str_replace("UT", "", $pubdate)));
date_default_timezone_set('America/Los_Angeles');
$today = date("mdY");
if ($newdate == $today) {
echo 'Match!';
} else {
echo "No Match!";
}
}
My problem is that ever string returns no match even when the strings are the same. How can I get this working?
Change
to
as you’re actually declaring
$newDate.