PHP: Hypertext Preprocessor
#1

[attachment=11720]
Introduction
Server side scripting language
Free Software (PHP License)
Supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC etc.)
Runs on different platforms (Windows, Linux, Unix, etc.)
Compatible with almost all servers used today (Apache, IIS, etc.)
PHP Opening and closing tags
<?
echo "Hello World";
?>
<?php
echo "Hello World";
?>
<script language="php">
echo "Hello World";
</script>
PHP vs ASP
ASP supports multiple programming languages.
This architecture is inherently slower and more memory intensive that PHP's model because each ASP language compiler runs in its own process.
So when ASP detects a Begin ASP tag (<%), it needs to do a context switch out of the HTML parser, and select the appropriate compiler. Then at the End ASP tag (%>) it will do a context switch back to the HTML parser.
ASP will always be inherently slower because of ASP's more multi-lingual There were many Open Source alternatives to PHP, including Perl, Python/Zope and JSP/Tomcat. It just seems to me that PHP is so similar to ASP that it's an easy switch.
Syntax
File Saving
Save your text files as *.php
Comments
We can use “//” to comment a line, or “/*” and “*/” to comment out several lines.
Print vs echo
We can also use “echo();” instead of “print();”
What is the difference?
Echo tends to be faster, but you can use Print for outputs. , Echo will be used instead.
Language syntax
conditional statements
loop structures
PHP4 and PHP5 support objectoriented
structures such as classes
A comprehensive library of functions for string
manipulation, date/time handling, cookies and session management etc.
Variables
Scope
– global and local
– static
Predefined variables
Ex: $_SERVER
Functions
User defined
Built-in
Functions always have global scope
PHP information
 phpinfo() displays information about PHP's configuration settings, loaded modules, variables, and more.
<?php
phpinfo();
?>
PHP server variables
$_SERVER is a reserved variable that contains all the information about the server. It is global and can be accessed from any scope of a PHP script.
<?php
echo "Referer: " . $_SERVER["HTTP_REFERER"] ."<br />";
echo "Browser: " . $_SERVER["HTTP_USER_AGENT"] . "<br />";
echo "User's IP address: " . $_SERVER["REMOTE_ADDR"];
?>
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: macro preprocessor arguments, hypertext markup language definition, hypertext markup language achtung, preprocessor and header files, hypertext markup language html, hypertext markup language attribute, what is preprocessor and give example,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: