PHP – Tutorial
Basic Introduction, Data types, Variables, Operators, Control Structures, Functions, Arrays, Strings And Patterns, Regular Expression
PHP – Web Programming
Anatomy of a Web Page, Forms and URLs, GET and POST, Managing File Uploads, HTTP Headers, Redirection, Compression, Caching, Cookies, Sessions
PHP – Security Concepts
Input Tainted, Whitelist vs. Blacklist Filtering, Filter Input, Escape Output, Website Security, Cross-Site Scripting, Database Security, Session Security, Filesystem Security, Remote Code Injection, Command Injection, Shared Hosting
PHP stands for PHP Hypertext Preprocessor. Taken directly from PHP’s home, PHP.net, “PHP is an HTML-embedded scripting language. Syntax PHP’s syntax is derived from many languages—predominantly the C language, but Perl has also had a lot of influence on its syntax. With the latest object-oriented additions, more Java-like syntax...
Read more »
PHP supports many different data types, but they are generally divided in two categories: scalar and composite. A scalar value contains only one value at a time. PHP supports four scalar types: boolean A value that can only either be true or false int A signed numeric integer value...
Read more »
Variables are temporary storage containers. In PHP, a variable can contain any type of data, such as, for example, strings, integers, floating-point numbers, objects and arrays. PHP is loosely typed, meaning that it will implicitly change the type of a variable as needed, depending on the operation being performed...
Read more »
Conversely to variables, constants are meant for defining immutable values. Constants can be accessed for any scope within a script; however, they can only contain scalar values. Constant names, like variables, are case-sensitive; they also follow the same naming requirements, with the exception of the leading $. It is...
Read more »
As their name subtly suggests, operators are the catalysts of operations. There are many types of operators in PHP, those commonly used are: • Assignment Operators for assigning data to variables • Arithmetic Operators for performing basic math functions • String Operators for joining two or more strings •...
Read more »
Control structures allow you to control the flow of your script—after all, if all a script could do was run from start to finish, without any control over which portions of the script are run and how many times, writing a programwould be next to impossible. PHP features a...
Read more »
Errors are an integral part of every computer language—although one that, most of the time, programmers would rather not have to deal with! PHP has some excellent facilities for dealing with errors that provide an excellent level of fine-grained control over how errors are thrown, handled and reported. Proper...
Read more »
The heart of PHP programming is, arguably, the function. The ability to encapsulate any piece of code in a way that it can be called again and again is invaluable—it is the cornerstone of structured procedural and object oriented programming. Basic Syntax Function syntax is, at itsmost basic, very...
Read more »
Arrays are the undisputed kings of advanced data structures in PHP. PHP arrays are extremely flexible—they allow numeric, auto-incremented keys, alphanumeric keys or a mix of both, and are capable of storing practically any value, including other arrays. With over seventy functions for manipulating them, arrays can do practically...
Read more »
As we mentioned in the PHP Basics , a number of operators behave differently if their operands are arrays. For example, the addition operator + can be used to create the union of its two operands: <?php $a = array(1, 2, 3); $b = array('a' => 1, 'b' =>...
Read more »
Iteration is probably one of the most common operations you will perform with arrays— besides creating them, of course. Unlike what happens in other languages, where arrays are all enumerative and contiguous, PHP’s arrays require a set of functionality that matches their flexibility, because “normal” looping structures cannot cope...
Read more »
There are a total of eleven functions in the PHP core whose only goal is to provide various methods of sorting the contents of an array. The simplest of these is sort(), which sorts an array based on its values: <?php $array = array('a' => 'foo', 'b' => 'bar',...
Read more »
Arrays are often used as stacks (Last In, First Out, or LIFO) and queue (First In, First Out, or FIFO) structures. PHP simplifies this approach by providing a set of functions can be used to push and pull (for stacks) and shift and unshift (for queues) elements from an...
Read more »
PHP Basic Introduction
PHP stands for PHP Hypertext Preprocessor. Taken directly from PHP’s home, PHP.net, “PHP is an HTML-embedded scripting language. Syntax PHP’s syntax is derived from many languages—predominantly the C language, but Perl has also had a lot of influence on its syntax. With the latest object-oriented additions, more Java-like syntax...
Read more »