Outreach Events

$doc = new DOMDocument();
// $doc->load(‘http://php.tailfish2.com/josh.xml’);
$doc->load(‘http://www.outreach.com/rss/events/joshmcdowell.xml’);
$arrFeeds = array();
foreach ($doc->getElementsByTagName(‘item’) as $node) {

$title = $node->getElementsByTagName(‘title’)->item(0)->nodeValue;
$org = $node->getElementsByTagName(‘Organization’)->item(0)->nodeValue;
$eventdate = $node->getElementsByTagName(‘EventDate’)->item(0)->nodeValue;
$eventtime = $node->getElementsByTagName(‘EventTime’)->item(0)->nodeValue;
$addldates = $node->getElementsByTagName(‘AdditionalDates’)->item(0)->nodeValue;
$address = $node->getElementsByTagName(‘Address’)->item(0)->nodeValue;
$city = $node->getElementsByTagName(‘City’)->item(0)->nodeValue;
$state = $node->getElementsByTagName(‘State’)->item(0)->nodeValue;
$ZIP = $node->getElementsByTagName(‘ZIP’)->item(0)->nodeValue;
$audience = $node->getElementsByTagName(‘AudienceType’)->item(0)->nodeValue;
$email = $node->getElementsByTagName(‘ContactEmail’)->item(0)->nodeValue;
$phone = $node->getElementsByTagName(‘ContactPhone’)->item(0)->nodeValue;

echo ”

$title

“;
if (strlen($org)>1){echo “Organization: $org”;}
if (strlen($eventdate)>1){echo ”
Event Date: $eventdate”;}
if (strlen($eventtime)>1){echo ”
Event Time: $eventtime”;}
if (strlen($addldates)>1){echo ”
Additional Dates: $addldates”;}
if (strlen($address)>1){echo ”
Address: $address, “;}
if (strlen($city)>1){echo “$city, “;}
if (strlen($state)>1){echo “$state  ”;}
if (strlen($ZIP)>1){echo $ZIP;}
if (strlen($audience)>1){echo ”
Audience Type: $audience”;}
if (strlen($phone)>1){echo “
Contact Phone:
$phone”;}
if (strlen($email)>1){echo ”
For more information, contact $email“;}
echo ‘

‘;
}

?>