History of SEO

First of all, in 1991 Tim Berners-Lee published a paper online talking about the World Wide Web (WWW).
In 1993 this web was made free of charge to anyone who wanted to use it.

From 1993-94 people started to build web pages. So in order to find web page coders started to build search engines.
By the mid, the late 90s the most popular search engine was “Alta Vista”.

The Alta Vista search results generally depend upon “meta keywords tag”. Within the source code of a web page, the website designers include a list of keywords that they thought were relevant to each page.

But unfortunately, that was open to abuse. People started listing keywords that were not relevant to the pages. Therefore users didn’t get great quality results.

After Google Ranking Algorithm –

In 1998, hence Google came along with their ranking formula. They calculated that it would be higher rank if a web page had more links to it.
The higher number of links pointed to your site compared with the number of pages that you link to, then the better your page rank score.
So people were looking for thousands of links to point to their web pages. In early 2000 this worked very very effective for improving your ranking on Google.

So webmasters swap links with their friends and other website owners that they don’t even know and weren’t even relevant to their particular website.
And as long as they swapped links they had more links pointing to their site then this would ultimately increase their ranking.

It wasn’t going to last forever because this was deteriorating and value the quality of search results.
If people wanted immediate news Google wasn’t delivering what searchers looking for.
Just because something was published a few years ago and it has thousands of links pointing to it.
It doesn’t make it most relevant source on that particular topic nowadays.
Perhaps something just published two hours ago with only two links pointing to it, doesn’t necessarily mean it’s less relevant.
It could be more relevant for today’s audience.

In the last couple of years, Google has made more and more changes to its algorithm and finally find a “Google Panda”. Panda is about quality content.

This algorithm look for following thinks:

  • volume of your content
  • is website optimized for mobile
  • determine whether or not the content is of good quality and much more
Help others by sharing the content!

How search engines work

When you search for something in search engines like Google, Yahoo, Bing or any search engine, you will get a list of links to web pages that could potentially answer your question.
But how it get? who decide the ranking of links in search results? how they give related results?

Let’s understand first, how search engine works.

There are five key areas involved in search engines work:

  1. Crawl: This is just way for a search engine to discover your site.
  2. Cache: Cache is about storing your web pages on web servers.
  3. Retrieve: Retrieving the information when a query is entered into Google.
  4. Rank: This is a way of ranking web pages through their algorithm.
  5. SERP: Search engine results page is the listing on a search.

A search engine(Google, Yahoo!, Bing) send its robots/crawler to crawl your site.
Google won’t look at how it looks visually but look at page source code.
You also can see the source code of any web page. Just right click on web page and select view page source.
This source code is actual code behind the particular web page and it can be slightly different depending on the browser.
Google actually crawls this code like what is a heading, title tag, and another different elements.

Then after that, they’ll move on to caching it. Caching is storing copies of the web pages on their systems, not necessarily every page.
These copies are of the source code behind the web page.

When someone searches for something in search box then Google cached all the sites around the world that it thinks are related and give you related search results.
But how do search engine determine a web page should be number one or at last of page or in first hundred pages.
So the way that Google does that is it passes all these results through ranking algorithm.

Google’s algorithm has probably about 200 or over 200 different elements to decide whether a web page is first link or last in search results.

Finally, the last stage is the SERP, Google will display its results in its search engine results page. Search engine results page can be different depending on device, location and also depend on whether or not you’re signed into Google.

Help others by sharing the content!

What is SEO

SEO stands for Search Engine Optimization.
It is the process of affecting the visibility of web pages or websites in a search engine’s search results.
It is the process of getting traffic from the free, organic, editorial or natural search results on search engines.
Search Engine Optimization is a process to improve the visibility of a website in search engines.

What is goal of a SEO? OR Why SEO is important?

The main goal of a SEO is to get a first rank in google search.
And the reason is because 95% of all web traffic goes to sites on the first page of the google search results.
So, if your site is first search result then you will get lot more visitors to your website.
Means lot more money you will get.
So this is why SEO is so important and everybody wants to learn about it.

Help others by sharing the content!

Multidimensional array

In associative array, we can store one value with only one key.
But if we want to store one or more keys for one value.
This can be done using multi-dimensional arrays.
A multi-dimensional array can be two-dimensional or three-dimensional array depending on indices.

A two-dimensional array is known as array of arrays.
A three-dimensional array is known as array of arrays of arrays.

 

Using multi-dimensional array you can store data in table form.
Let’s see following example:

Subject Marks Grade
Mathematics 23 D
Science 45 C
English 65 B
Drawing 80 A

Now this above table can be stored using multi-dimensional array as.

Output:

You can print this table using for loop.

Output:

Help others by sharing the content!

Associative array

Associative array is an second type of array.
You can define associative array in following two ways:

OR

 

Example

Output:

 

Output:

Help others by sharing the content!

Indexed array

PHP indexed array is a simple type of array.
An indexed array use number as access keys.
You can define indexed array in following two ways:

OR

Example

Output:

Output:

Here, $country is a name of variable.
0,1,2 are the index numbers of the elements.
India, Australia, Switzerland are the values assigned to array elements.

Help others by sharing the content!

foreach loop

PHP foreach loop works only on arrays and objects.
Array pointer is always incremented by one.

There are two syntaxes for foreach loop:

Syntax of PHP foreach loop

OR

 

Example using value

Output:

 

Example using key

Output:

 

Example

Output:

Help others by sharing the content!

for loop

PHP for loop is the most complex loops in PHP. They behave like their C counterparts.

Syntax of PHP for loop:

Following is given a general syntax of for loop in PHP:

In the beginning, loop condition is evaluated. If it evaluates to TRUE, the loop continues and the nested statement(s) are executed.
If it evaluates to FALSE, the execution of the loop ends.

All three expression, initialization, condition, increment/decrement can be empty or multiple.
If the condition is empty then loop will execute infinite considering it is true.
If the expressions are multiple then they are separated by commas.
 

Flowchart of PHP for loop

php-for-loop
 

Example
Consider the following examples.

Output:

Help others by sharing the content!

do-while

PHP do-while loop are very similar to while loop.
Only one difference in do-while, loop condition is checked at end of each iteration.
Whereas, in while loop condition is checked at beginning of loop.
Also, in do-while, loop is execute at onces without checking condition.
Output of do-while loop and while loop is same.

 

Syntax of PHP do-while

Following is given a general syntax of do-while loop in PHP:

 

Flowchart of PHP do-while loop

php do-while loop
 

Example

Output:

Help others by sharing the content!

while loop

PHP while loop execute a multiple statements repeatedly until while expression is true.

 

Syntax of while loop:

Following is given a general syntax of while loop in PHP:

The multiple statements inside while loop get executed only when expression is true.
These multiple statements enclosed within the curly braces or using the alternate syntax:
Initially if while condition is true then only while statements will execute otherwise they will not execute at even once.

 

Flowchart of PHP while loop

PHP-while-loop
 

Example

Output:

Or you can use while loop as following:
It will print same output as above example only we use endwhile instead curly braces { }.

Help others by sharing the content!