Sie sind auf Seite 1von 2

PHP Important Points:

A static website is a website which is purely written in HTML and it doesnt interact with any
database.
A dynamic website is a website which is interactive, means it interacts with database frequently
and is written in html with server side scripting language to enable functionality of the website.
Open Source Software is nothing but computer software which is available in the form of source
code. Since it is free software, so anybody can download and use it to its full extent of
functionalities. There is no need to invest or buy it separately.
PHP is a server side scripting language. Easy to learn when compare to all other server side
scripting languages like ASP.NET, PERL, etc. It is platform independent language which means it
can run on any kind of OS platform and it supports all kinds of servers like APACHE, IIS, etc. It
supports all kinds of databases like Oracle, DB2, MySQL, etc.
PHP stands of Hypertext Pre-Processor. The father of PHP is Rasmus Lerdorf.
The methods available in form submitting are GET and POST methods.
We can submit a form without a submit button by using a function called
document.form.submit(). We can use a simple java script code linked to an event trigger of any
form field.
To get the browser properties using PHP, we can use
<?php
Echo $_SERVER[HTTP_USER_AGENT];
$browser=get_browser(null, true);
Print_r($browser);
?>
A session is a logical object created by PHP engine to allow you to preserve the data across
subsequent HTTP requests. Session are commonly used to store temporary data.
To register a variable in the session
<?php
Session_register($variable);
?>
To destroy all the sessions we can use the function session_destroy();.
Unset() function is used to undefined a defined variable.
We can pass a variable through the navigation between the pages by registering a variable into
session, by passing the variable as cookie, or by passing the variable as part of url.
To know the total number of elements in the array we can use the functions sizeof($array) and
count($array).
The type of header that PHP supports is $_SERVER[HTTP_ACCEPT].
To create a database using php we can use the following sytax
Mysql_create_db();
Include() function takes all the contents in a specified file and includes it in the current file. If an
error occurs it generates a warning message but the script never stops execution. Include_once()
function is used to include the specified file only once and further call will be ignored.
Require() function is identical to Include() function but when an error occurs, it generates a fatal
error and the execution of the script will be stopped. Require_once() is also same like
Include_once().

To remove html and php tags from a comment we can use the function strip_tags().
To convert normal plain text into a code we can use hash algorithms which are available in the form
of functions. They are, sha1($string), md5($string).
We can convert the parameters into variables by using the function parse_str($expression).
To remove the extra spaces before and after the variable we can use the function trim($string).
To convert a string to upper case and lower case we can use the corresponding functions
strtoupper() and strtolower().
To convert the first letter of the string to upper, we can use the function ucfirst().
To convert the first letter of each word to uppercase, we can use the function ucwords().
To shuffle the given string we can use the function str_shuffle($string).
Nl2br() function is used to add new line to the string in output.
Str_replace() and str_ireplace() functions are used to replace a string with a give string.

Das könnte Ihnen auch gefallen