Showing posts with label PHP SEO. Show all posts
Showing posts with label PHP SEO. Show all posts

Wednesday, February 18, 2015

Get Google Page through PHP for Multiple URL

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


Google PageRank Script PHP

Tuesday, August 21, 2012

Alexa Rank Script PHP - Get Alexa Rank in PHP



To Find Alexa Rank in php using following function

PHP Script to get Alexa Rank

<?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");

?>


Monday, March 5, 2012

Page Loading Time PHP


Execution of server side scripting need to optimize in order to get the Optimized page loading time. In this case most of the Server Side Response typically not more than 2 to 30 seconds. In this case we need to find the Exact page loading time in PHP using the following Script.


Find Page Loading Time PHP
<?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';   
?>

Sunday, March 4, 2012

Remove HTML comments PHP


Cleaning or Removing HTML comments is one of the main part of Optimizing web pages. Here is the solution to Remove HTML Comments with PHP.

To Remove HTML Comments in PHP, We need to use the following Technique.

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;
?>

Saturday, February 25, 2012

Reduce HTTP Request with Data URI in PHP


A part of website optimization technique is Reduce no of HTTP Request when user attempt to open our Web page from our website. HTTP Request count is an important factor for Traffic worthy websites to make your web pages / websites more responsive on time. In this factor of HTTP Request optimization to reduce the HTTP request count of various images in our websites by Rewriting with Data URI Scheme. Data URI is the technology which is used to Reduce and Optimize HTTP request and response.



For example If you have a gallery section in your website. Gallery images are in two Sections one is Thumbnails and another one is actual images. in this case set of 5 Images will request 10 HTTP request every time the Page opens. in this case we can use Data URI with PHP to reduce this HTTP request 0, Data URI will cheat our server and retrieve the image data as plain code along with our standard HTML code.

Wednesday, February 22, 2012

Directory Model URL Rewriting with htaccess and map content with php

Creating a dynamic content for web application, we need to consider the Search Engine Optimized web URL structure to main the quality of our web development says "SEO Friendly", Search Engines are clearly identified our web content if we have Directory Model URL structure in our websites. As a developer SEO Friendly URL is very important to any project. Let me explain How to create Directory Model URL Rewriting with htaccess and how to map your content with php.

.htaccess directory structure url rewriting



directory structure:

/index.php
/.htaccess
/include/home.php
/include/about_us.php
/include/contact_us.php

Saturday, October 8, 2011

Google PageRank Script New Updated toolbar query url

Due to the problem on PR Finding script. When we identify the problem of this script, I have found that query URL been changed by Google which we fetch PR problematically. Here is the updated Google PageRank Script New Updated toolbar query URL

The Old URL Was This -
http://toolbarqueries.google.com/search?client=navclient-auto&features=Rank&ch=SITECHECKSUM&q=info:SITENAME.com

Tuesday, September 27, 2011

PHP Google PageRank Script

Finding Google PageRank for multiple URLs is difficult process,  Here is the my solution to find Google PageRank for multiple URLs at the same time, PR Finder PHP Script here is the best solution for Finding PR for any web url. hope this very usefull for your projects.


PHP Google PageRank finder Script 

Tuesday, August 23, 2011

Create SEO Friendly Page or Slug URL using PHP

Creating Search Engine Friendly  page URL from your Page Title / heading will very helpful to generate a Highly optimized keyword rich URLs for your Website,  Here is the function to get the Search Engine Friendly SEO Friendly Page URL from given string. while you are generating Dynamic content.


<?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
?>