Login or Register Now   Email:  Password:   

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($fp128);
    
/*** 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

  • The latest stable version of the Linux kernel is: 2.6.27.6
  • The latest prepatch for the stable Linux kernel tree is: 2.6.28-rc5
  • The latest snapshot for the stable Linux kernel tree is: 2.6.28-rc5-git3
  • The latest 2.4 version of the Linux kernel is: 2.4.36.9
  • The latest prepatch for the 2.4 Linux kernel tree is: 2.4.37-rc2
  • The latest 2.2 version of the Linux kernel is: 2.2.26
  • The latest prepatch for the 2.2 Linux kernel tree is: 2.2.27-rc2
  • The latest -mm patch to the stable Linux kernels is: 2.6.28-rc2-mm1