Apache acts your web server. Its main job is to parse any file requested by a browser and display the correct results according to the
code within that file. PHP is a server scripting language that allow your web site to be truly dynamic. PHP stands for Hypertext
Preprocessor.
PHP programs are written using a text editor,such as Notepad or WordPad,just like html pages. Unlike html ,though,php pages,for
the most part ,end in a .php extension. This extension signifies to the server that it needs to parse the php code before sending the
resulting html code to the viewer's web browser. One of the benifits of using php is that it is relatively simple and straightforward. As
with any computer language,there is usually more than one way to perform the same function.
A constant is a placeholder for a value that you reference within your code. Constants are typically named with capital letters and the
values are usually formally defined before using them. You defien a value assigned to a constant with the php function define().
Unlike constants, variables are obviously meant to be variable-they are meant to change or be changed at some point in your
program. Variables also do not need to be defined or declared and can simply be assigned when needed. Variables are denoted
with a dollar sign and are case-sensitive, as are constants. PHP also has numerous built-in mathematical functions that you can use
on variables that contain numbers such as the following:#rand;#ceil().
A session is basically a temporary set of variables that exists only until the browser has shut down. Every session is assigned a
unique session ID, which keeps all the current information together. Your seesion ID can either be passed through the url or through
the use of cookies. Cookies are tiny bits of information stored on your web sitre vistor's computer. There appears to be some sort of
paranonia about using cookies ,so many people choose to disable this feature in theiw web browsers. As with includes,functuions
make your code more efficient and easier to debug. Functions are blocks of coede that can be called from anywhere in your
program. An array is just a row of information and the keys are the column headers. Keys are identifiers to help keep the information
organnized and easy to use.
GD is written in c++ and allow for the manipulation of certain image types. Because PHP can not automatically process images with
built-in functions,you need to make sure you have the GD library enabled. Fortunately, a bundled version comes with all recent
versions of php.
To help make things easier when using object-oriented programming,php5 has provided a handful of so-called magic methods.
These magic methods are specially named methods for all classes which are called automatically in certain scenarios. PHP5
includes a handful of magic methods that you can implement to provide special functionality for your classes. The three magic
methods -call,-get() and -set all allow you to access methods and properties of an object that haven't been explicitly defined. The
magic method _call allows you to provide actions or return values when undefined methods are called on object. The magic methods
_get and _set allow you to specify custom functions to store and retrieve data in properties that are not already defined in the class.
PHP's url wrappers has been extended to become the basic mechanism of file interaction in general. One of the consequences of
this is that you can now use url in almost any context where a local file path would be appropriate. The most significant limitation
compared with say, java is that php streams are all bytes streams. To stream something else-object in particular-you need
serialization to convert it into something that will go through a stream.
code within that file. PHP is a server scripting language that allow your web site to be truly dynamic. PHP stands for Hypertext
Preprocessor.
PHP programs are written using a text editor,such as Notepad or WordPad,just like html pages. Unlike html ,though,php pages,for
the most part ,end in a .php extension. This extension signifies to the server that it needs to parse the php code before sending the
resulting html code to the viewer's web browser. One of the benifits of using php is that it is relatively simple and straightforward. As
with any computer language,there is usually more than one way to perform the same function.
A constant is a placeholder for a value that you reference within your code. Constants are typically named with capital letters and the
values are usually formally defined before using them. You defien a value assigned to a constant with the php function define().
Unlike constants, variables are obviously meant to be variable-they are meant to change or be changed at some point in your
program. Variables also do not need to be defined or declared and can simply be assigned when needed. Variables are denoted
with a dollar sign and are case-sensitive, as are constants. PHP also has numerous built-in mathematical functions that you can use
on variables that contain numbers such as the following:#rand;#ceil().
A session is basically a temporary set of variables that exists only until the browser has shut down. Every session is assigned a
unique session ID, which keeps all the current information together. Your seesion ID can either be passed through the url or through
the use of cookies. Cookies are tiny bits of information stored on your web sitre vistor's computer. There appears to be some sort of
paranonia about using cookies ,so many people choose to disable this feature in theiw web browsers. As with includes,functuions
make your code more efficient and easier to debug. Functions are blocks of coede that can be called from anywhere in your
program. An array is just a row of information and the keys are the column headers. Keys are identifiers to help keep the information
organnized and easy to use.
GD is written in c++ and allow for the manipulation of certain image types. Because PHP can not automatically process images with
built-in functions,you need to make sure you have the GD library enabled. Fortunately, a bundled version comes with all recent
versions of php.
To help make things easier when using object-oriented programming,php5 has provided a handful of so-called magic methods.
These magic methods are specially named methods for all classes which are called automatically in certain scenarios. PHP5
includes a handful of magic methods that you can implement to provide special functionality for your classes. The three magic
methods -call,-get() and -set all allow you to access methods and properties of an object that haven't been explicitly defined. The
magic method _call allows you to provide actions or return values when undefined methods are called on object. The magic methods
_get and _set allow you to specify custom functions to store and retrieve data in properties that are not already defined in the class.
PHP's url wrappers has been extended to become the basic mechanism of file interaction in general. One of the consequences of
this is that you can now use url in almost any context where a local file path would be appropriate. The most significant limitation
compared with say, java is that php streams are all bytes streams. To stream something else-object in particular-you need
serialization to convert it into something that will go through a stream.