Posted by BRD in PHP, TutorialsDec 16th, 2009 | 4 Comments
Classes and Objects:
The programming paradigm we have learned so far is called Procedural Paradigm. In Procedural programming paradigm, programmer writes a program as collections of independently behaving procedures and makes use of procedure call to access those procedures. As we already discussed in Part8, how procedural programming is a better choice than a simple unstructured programming. It has been a long time, programmers have started thinking about new paradigm called Object oriented paradigm (OOP) which provides a better way to develop big and complex system than procedural programming....
Posted by BRD in PHP, TutorialsDec 5th, 2009 | 7 Comments
Forms:
A form is an area where user can input data. The place in the form where user input data is called form element. A form element can be a text field, text area field, drop-down list, radio buttons and checkbox. In this tutorial we will apply the knowledge we have gained so far and use it with HTML forms. The best thing to use PHP with HTML is that any elements in HTML forms are directly available in PHP scripts. That means the data entered in HTML forms can be manipulated using PHP scripts.
Posted by BRD in PHP, TutorialsDec 2nd, 2009 | 7 Comments
Function:
A function is a subprogram that performs a specific task when called by the main program. It is always a good practice to divide a huge program into a number of subprograms until elementary functions are reached. More clearly, a huge program should be divided into number of functions, and a function precisely should do one job. Suppose, we have a big program that reads data from user at the beginning, save data to a database and displays the saved data at the end.
Posted by BRD in PHP, TutorialsNov 23rd, 2009 | 3 Comments
Array:
Array is a systematic collection of data of similar data types that can be accessed by numeric index. Array is one of the most important and oldest data structures that are used to implement other data structures like strings, maps, vector etc. An array in PHP is in fact an ordered map type that associates values to keys. We suggest readers to not get confused with map type here, simply understand PHP array as a data type that can be accessed using keys.
Posted by BRD in PHP, TutorialsNov 20th, 2009 | 9 Comments
Strings:
A string is an array of characters. This tutorial demonstrates the use of string to manipulate text. A string can be represented in one of the following four ways; single quoted, double quoted, heredoc syntax and nowdoc syntax. Before describing each string in detail, it would be appropriate to discuss about escape sequence. Escape sequence are used to format the output text and other output options.
Posted by BRD in PHP, TutorialsNov 15th, 2009 | 5 Comments
Loops
A loop is a programming construct that facilitates programmer to execute some code number of times or a specified condition is true. For instance, we need to read a file stored in computer and print it in screen. Suppose the function available to read a file reads one line at a time and the file contains many lines, we have to write the same line of code many times to read one line at a time from the file. By using loops we can execute the same code number of times called iterations to read the whole file, one line at a time until there is no line left in the file.
Posted by BRD in PHP, TutorialsNov 10th, 2009 | 7 Comments
Control Statements
A program is a collection of modules working together to perform certain task. The modules can be thought independently which always produces the same set of output for a given set of input. Control statements control the execution of a program by executing those modules once at a time in a meaningful order, known as flow of control. Basically, there are two types of control statements, branching statements and loops. In this tutorial, we will discuss branching statements in detail.
Posted by BRD in PHP, TutorialsNov 7th, 2009 | 13 Comments
Operators
An operator is a type of function which acts on operands often called inputs and produce results. In PHP, there are three types of operators. Increment operator ++ and decrement operator — belongs to the first operator group called unary operator. Unary operator always acts on single operand. The second group called the binary operator acts on more than two operands. .
Posted by BRD in PHP, TutorialsNov 5th, 2009 | 8 Comments
Data Types:
PHP supports eight primitive types; four scalar types two compound and two special types. In this section we will discuss scalar types; boolean, integer, float and string. Other four array, object, resource and null will be discussed in the later sections.
Boolean:
To define boolean variable we can specify TRUE or FALSE, both are case insensitive. The size of the Boolean variable is one byte.
Posted by BRD in PHP, TutorialsNov 3rd, 2009 | 23 Comments
Introduction:
PHP is a widely used open source server side scripting language that is used to create dynamic and interactive web pages. PHP can be directly embedded into the HTML code and hence, is perfect for any web development. The syntax of PHP is very similar to Perl and C. PHP works on Apache web server and also supports Microsoft Internet Information Server.
Installing PHP:
If you want to use PHP for website and web applications you need three things; PHP itself, a web server and web browser. To design and develop web pages you need a web development application. In addition, if you want...