15 lines
581 B
PHP
15 lines
581 B
PHP
<?php
|
|
$url = "http://feeds.feedburner.com/quotationspage/qotd";
|
|
if ($url)
|
|
{
|
|
do
|
|
{
|
|
$x = rand(0,10);
|
|
$xml = new SimpleXMLElement($url, NULL, TRUE);
|
|
} while (!$xml && trim($xml->channel->item[$x]->description) == "");
|
|
$string = trim(preg_replace("/<p>(.*)/", "", $xml->channel->item[$x]->description));
|
|
$string = trim(preg_replace("/<a href(.*)<\/p>/", "", $string));
|
|
$string = preg_replace("/\"/", "", $string);
|
|
echo trim($string) . "<br/>(" . $xml->channel->item[$x]->title . ")<br/>Source: <a href=\"http://www.quotationspage.com/\">QuotationsPage</a>";
|
|
}
|
|
?>
|