leungeric.com

Digg del.icio.us Technorati StumbleUpon Twitter

Get Remote Webpage Information

Code Snippets | PHP | PHP | Tutorials & Resources

1 Star2 Stars3 Stars4 Stars5 Stars (3.67 out of 5)
Loading ... Loading ...

Simple code snippet to retrieve remote webpage information, including page title, page description, and keywords

<?php
$url = “http://www.leungeric.com/”;
$fp = fopen( $url, ‘r’ );
$content = “”;
while( !feof( $fp ) ) {
$buffer = trim( fgets( $fp, 4096 ) );
$content .= $buffer;
}

$start = ‘<title>’;
$end = ‘<\/title>’;

preg_match( “/$start(.*)$end/s”, $content, $match );
$title = $match[ 1 ];

$metatagarray = get_meta_tags( $url );
$keywords = $metatagarray[ "keywords" ];
$description = $metatagarray[ "description" ];

echo “<div>URL: $url</div>\n”;
echo “<div>Title: $title</div>\n”;
echo “<div>Description: $description</div>\n”;
echo “<div>Keywords: $keywords</div>\n”;
?>

Feedburner Count As Plain Text

Code Snippets | PHP | Tutorials & Resources | WordPress

1 Star2 Stars3 Stars4 Stars5 Stars (5 out of 5)
Loading ... Loading ...

Make a call to the Feedburner API requesting the feedcount for a given burned feed.

(Read more)

Password Protection using WWW-Authenticate

Code Snippets | PHP

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

This creates simple login function using the WWW-Authenticate header.

(Read more)

fputcsv function for PHP4

Code Snippets | PHP

1 Star2 Stars3 Stars4 Stars5 Stars (2.5 out of 5)
Loading ... Loading ...

This is an exact replication of PHP5 fputcsv function.

(Read more)

1

Sponsors