Location: PHPKode > scripts > Today's Joke > todays-joke/class.joke.php
<?PHP
class joke{
	function getJoke()
	{
		$lnk="http://www.jokes2go.com/jtoday.html";
		$pg=file_get_contents($lnk);
		if(strpos($pg,"<pre>")!==false)
		{
			$ii=strpos($pg,"<pre>")+6;
			$ij=strpos($pg,'<',$ii);
			$joke=substr($pg,$ii,$ij-$ii);
		}else{
			$joke="Not found";
		}
		return $joke;
	}
}
?>
Return current item: Today's Joke