Here is the PHP Script for best solution for Finding PR
for multiple URLs hope this very useful for your projects.

<?php function alexaRank($domain){ $remote_url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url='.trim($domain); $search_for = '<POPULARITY URL'; $part = NULL; if ($handle = @fopen($remote_url, "r")) { while (!feof($handle)) { $part .= fread($handle, 100); $pos = strpos($part, $search_for); if ($pos === false) continue; else break; } $part .= fread($handle, 100); fclose($handle); } $str = explode($search_for, $part); $str = @array_shift(explode('" SOURCE="panel"/>', $str[1])); $str = explode('TEXT="', $str); return $str[1]; } echo alexaRank("google.co.in"); ?>
<?php function page_loading_time() { list ($msec, $sec) = explode(' ', microtime()); $microtime = (float)$msec + (float)$sec; return $microtime; } $start=page_loading_time(); usleep(100000); // Delaying page output 0.1 second for testing purpose. echo "<br />"; $end = page_loading_time(); // Print results. echo 'Page Loading Time: <b>' . round($end - $start, 2) . '</b> seconds'; ?>
![]() |
Remove HTML Comments with PHP |
<?php // Start OutputBuffer ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Remove HTML Comments</title> </head> <body> <!-- // HTML Comments for code identification --> <!-- Mutiple Closing Tags--> <h1>Remove HTML Comments Example</h1> <!-- Unclose End Tag--> <p>This is an example to remove HTML Comments <p> </body> </html> <?php // Store HTML Output Buffer as variable with ob_get_clean(); $html = ob_get_clean(); // Specify configuration $config = array( 'indent' => false, 'hide-comments' => true, 'output-xhtml' => true, 'wrap' => false ); // Tidy $tidy = new tidy; $tidy->parseString($html, $config, 'utf8'); $tidy->cleanRepair(); // Output echo $tidy; ?>
<?php $PageTitle="<h1>Education 's and Cultural <pre>Programs\" for <br> schools! and colleges! (2010-11)</h1>"; // @ Desc: Prepare SEO Friendly URL // @ Parm: String with Mixed with tags and special characters // @ Return: SEO Frinedly URL out by replacing spaces and special characters with Hyphen(-) function prepare_seo_friendly_url($string) { // Remove HTML Tags if found $string=strip_tags($string); // Replace special characters with white space $string=preg_replace('/[^A-Za-z0-9-]+/', ' ', $string); // Trim White Spaces and both sides $string=trim($string); // Replace whitespaces with Hyphen (-) $string=preg_replace('/[^A-Za-z0-9-]+/','-', $string); // Conver final string to lowercase $slug=strtolower($string); return $slug; } // Example Output: echo prepare_seo_friendly_url($PageTitle); // Output: // education-and-cultural-programs-for-schools-and-colleges-2010-11 ?>