Friday, March 18, 2011

PHP Interview Question Part 1

1. What is PHP?

PHP stands for: PHP Hyper Text Preprocessor.

2. Why PHP?

PHP runs on different platforms (Windows, Linux, Unix, etc.).
PHP is compatible with almost all servers used today (Apache, IIS, etc.).
PHP is FREE to download from the official PHP resource: www.php.net.
PHP is easy to learn and runs efficiently on the server side.

3.What is a PHP File?

PHP files may contain text, HTML tags and scripts.
PHP files are returned to the browser as plain HTML.
PHP files have a file extension of  “.php”, “.php3?, or “.phtml”.

4. What is caching?

“Meta tags are easy to use, but aren’t very effective. That’s because they’re usually only honored by browser caches (which actually read the HTML), not proxy caches (which almost never read the HTML in the document).”

If a page is changed “nearly every day”, it will hardly be a problem in practical terms.

And in any case, it’s something to be handled at the server level, by making the server send some useful expiration information, using whatever needs to be done on a specific

server. Telling that a page expired twenty years ago is hardly a good idea if you can expect its lifetime to be a day or more, or at least several hours. Defeating proxy caching brutally wouldn’t be a good idea (and meta tags won’t do that, so the errors in a sense cancel out each other, so to say This has to be at the beginning of the file, with nothing before (e.g. no blank). This is a brute force variation, some adjustments are useful. (Server supporting PHP is recommended)Meta-tags wont work with proxies.

Proxies don’t work on the ‘HTML-layer’ but HTTP. Things depend on proxy settings also.”The Pragma header is generally ineffective because its meaning is not standardized and few caches honor it. Using <meta http-equiv=…> elements in HTML documents is also generally ineffective; some browsers may honor such markup, but other caches ignore it completely.” – Web Design Group That’s because the no-cache pragma is supposed to be part of a HTTP *request*. And *this* has been standardized since way back.

5. Are the PHP variable names case sensitive?
Yes. The php variable names cases sensitive. 

6. Are the PHP function names case sensitive?
No, Its not case sensitve functions.

7. What are the differences between PHP 3 and PHP 4?
Here’s a list of some of the more important new features:
  • Extended API module.
  • Generalized build process under Unix.
  • Generic web server interface that also supports multi-threaded web servers
  • Improved syntax highlighter.
  • Native HTTP session support.
  • Output buffering support.
  • More powerful configuration system.
  • Reference counting.

 

No comments:

Post a Comment