Monthly Archives: August 2015

home » 2015 » August

Basic terms of web robot.txt

What is a Web robot:

In basic, web robot is simply a program. Robot is used to automatically and recursively traverses a Web site to retrieve document content and information. Search engine spiders is the most common types of Web robots. These robots visit Web sites and follow the links to add more information to the search engine database.

Web robots often go by different names. You may hear them called:

  • spiders
  • bots
  • crawlers

Commonly Web robots is used to index a site for a search engine. But robots can be used for other purposes as well. Some of more common uses are:

  • Link validation – Robots can follow all the links on a site or a page, testing them to make sure they return a valid page code. The advantage to doing this programmatically is inherently obvious, the robot can visit all the links on a page in a minute or two and provide a report of the results much quicker than a human could do manually.
  • HTML validation – Similar to link validation, robots can be sent to various pages on your site to evaluate the HTML coding.
  • Change monitoring – There are services available on the Web that will tell you when a Web page has changed. These services are done by sending a robot to the page periodically to evaluate if the content has changed. When it is different, the robot would file a report.
  • Web site mirroring – Similar to the change monitoring robots, these robots evaluate a site, and when there is a change, the robot will transfer the changed information to the mirror site location.

Read the rest >>

5 PHP Interview Questions Series – 2

Question 1: Explain the output of the below code:

Surprisingly to many, the above code will output bool(true) seeming to imply that the and operator is behaving instead as an or.

The issue here is that the =  operator takes precedence over the and  operator in order of operations, so the statement $x = true and false  ends up being functionally equivalent to:

This is, incidentally, a great example of why using parentheses to clearly specify your intent is generally a good practice, in any language. For example, if the above statement $x = true and false  were replaced with $x = (true and false) , then $x  would be set to false as expected.


Question 2: What will $x  be equal to after the statement $x = 3 + "15%" + "$25" ?

The correct answer is 18.Read the rest >>

5 PHP Interview Questions Series

Question 1: What will be the output of the code below?

The output is:  bangladesh does not contain bangla


So what is the explanation?

The problem here is that strpos()  returns the starting position index of $str1 in $str2 (if found), otherwise it returns false. So in this example, strpos()  returns 0 (which is then coerced to false when referenced in the if statement).


Question 2: What will be the output of the code below and why?

The output is:
In the snippet of code there are two key facts that we need to keep in mind: … Read the rest >>