PHP Finger Client Linux Kernel
This example shows how to create a simple finger client with php. The script connects to kernel.org to fetch the latest linux kernel information. Here a simple unordered list is created to display the contents.
<ul>
<?php
/*** connect to port 79 ***/
$fp = fsockopen('kernel.org', 79);
/*** get the info ***/
while( !feof($fp) )
{
/*** get the text ***/
$text = fgets($fp, 128);
/*** make sure we have a valid line ***/
if(trim($text) != '')
{
/*** add to the list ***/
echo '<li>'. trim($text).'</li>';
}
}
/*** close the file pointer ***/
fclose($fp);
?>
</ul>
Demonstration
- kernel.org not accepting connections at this time
Support PHPRO.ORG
Search
PHPRO.ORG Poll
Warning: Participation in PHPRO.ORG polls may incorrectly lead you to believe your opinions matter.

RSS Feed




