Snippets

Here is your code snippet

Code


World population

Display the world population

<?php
//this script will display the worlds population
//this is the url with the info
$url = "http://www.census.gov/cgi-bin/ipc/popclockw/index.html";
//open this file to read
$fp = fopen($url, "r");
$search = fread($fp, 50000);
fclose($fp);
//search for the tags which surround the figure
$search = ereg("<p><h1>(.*)</h1>", $search, $content);
echo "<H1>$content[1]</H1>";
?>