All these functions generate a hash code and the basic difference among them is the length of the generated hash.

crc32() gives 32 bit code
sha1() gives 128 bit code
md5() gives 160 bit code (generally used to avoid collisions)

 
 

htmlspecialchars only takes care of <, >, single quote, double quote and ampersand whereas htmlentities translates all occurrences of character sequences that have some other meaning in HTML.

 
 

echo, print and printf are used for printing strings but the basic difference between them is: echo is the most primitive of them, and just outputs the contents following the construct to the screen. print is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. And you can pass multiple parameters to echo, like:


and it will output the string “Welcome Jack”

Whereas print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP.

printf is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and printf.

 
 

The basic difference is how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

 
 

It means that the argument is passed by reference and the function will likely modify it corresponding to the documentation. You can pass only variables this way and you don’t need to pass them with & in function call

 
 

The biggest advantage of PHP over P E R L is that PHP was designed for scripting for the web where P E R L was designed to do a lot more and can because of this get very complicated. The flexibility / complexity of P E R L makes it easier to write code that another author / coder has a hard time reading. PHP has a less confusing and stricter format without losing flexibility. PHP is easier to integrate into existing HTML than P E R L. PHP has pretty much all the ‘good’ functionality of P E R L: constructs, syntax and so on, without making it as complicated as P E R L can be. P E R L is a very tried and true language, it’s been around since the late eighties, but PHP is maturing very quickly.

 
 

PHP is commonly said to be faster and more efficient for complex programming tasks and trying out new ideas. PHP is generally referred to as more stable and less resource intensive as well. Cold Fusion has better error handling, database abstraction and date parsing although database abstraction is addressed in PHP 4. Another thing that is listed as one of Cold Fusion’s strengths is its excellent search engine, but it has been mentioned that a search engine is not something that should be included in a web scripting language. PHP runs on almost every platform there is; Cold Fusion is only available on Win32, Solaris, Linux and HP/UX. Cold Fusion has a good IDE and is generally easier to get started with, whereas PHP initially requires more programming knowledge. Cold Fusion is designed with non-programmers in mind, while PHP is focused on programmers

 
 

ASP is not really a language in itself, it’s an acronym for Active Server Pages, the actual language used to program ASP with is Visual Basic Script or JScript. The biggest drawback of ASP is that it’s a proprietary system that is natively used only on Microsoft Internet Information Server (IIS). This limits it’s availability to Win32 based servers. There are a couple of projects in the works that allows ASP to run in other environments and webservers: InstantASP from Halcyon (commercial), Chili!Soft ASP from Chili!Soft (commercial). ASP is said to be a slower and more cumbersome language than PHP, less stable as well. Some of the pros of ASP is that since it primarily uses VBScript it’s relatively easy to pick up the language if you’re already know how to program in Visual Basic. ASP support is also enabled by default in the IIS server making it easy to get up and running. The components built in ASP are really limited, so if you need to use “advanced” features like interacting with FTP servers, you need to buy additional components

 
 

Generally it is, but as PHP is mostly used as a web scripting language it runs in the web servers context, thus visual objects will never appear on the servers desktop. If you use PHP for application scripting e.g. in conjunction with PHP-GTK there is no limitation in accessing and manipulating visual objects through COM.

 
 

A script may include many files, this enables PHP coders to write some of the code once, and use it in many scripts, to include an external file into your script, you can use one of the following:

1. include: reads the external file, and interprets it, if the external file can’t be found, a warning is produced, and the execution continues.

2. require: the same as includes, but it causes the execution to stop.

3. include_once: works the same way as include, but the included file will be interpreted just once, at the first time it’s included, if it’s included again in the same file, it won’t be interpreted again.

4. require_once: the same as require, but also interpreted once like include_once.