Source: Drupal.org
This PHP Tutorial for beginners is a continuation of Steps on how to program on PHP: A beginners guide on PHP programming Part 1 and Part 2. If you did not read it yet, please read it first to facilitate better understanding on this hub.
Steps on how to program on PHP: A beginners guide on PHP programming Part 3
Tackles about:
-PHP Loops and Sample Scripts
-PHP Arrays and Sample Scripts
-PHP Functions and Sample Scripts
PHP Video Tutorials
“Learn the PHP basics from 17 info packed video tutorials.” “On CD”
Current Bid: $1.99
PHP Programming Video Training tutorials CBT – 7+ Hrs
Current Bid: $4.99
Learn php -mysql and web develop video &docs tutorials
Current Bid: $5.99
Install Scripts 7 Video Tutorials, Learn MySQL Setup , Install PHP, CGI Scripts
Current Bid: $4.00
PHP Loops (while, do-while loops, for loop and foreach loop)
There are also four kinds of Loops in PHP programming. The while loop, do-while loop, for loop and for each loop.
While Loop is used if the php programmer want to execute a block of code over and over while the condition on the while loop is true.
Syntax:
While(condition)
{
..code here
}
See PHP Code Example on While Loop
Available PHP Books
PHP & MySQL: The Missing Manual, Brett McLaughlin, Excellent Book
Current Bid: $5.97
Core Web Application Development with PHP and MySQL by Marc Wandschneider…
Current Bid: $24.99
PHP and MySQL in Easy Steps by Mike McGrath (2012, Paperback)
Current Bid: $17.40
Beginning PHP and MySQL:From Novice to Professional Web Page Design GREAT PRICE
Current Bid: $21.50
Professional PHP5 (Programmer to Programmer), Alec Cove, Steven D. Nowicki, Heow
Current Bid: $4.47
Do-while loop is used if the programmer wants to execute the codes once and repeat it again once for every true condition specified in its while condition.
Syntax:
Do
{
Codes to here
}while(condition);
See PHP Code Sample on Do-While Loop
For loop is used if the programmer wants to repeat the block of codes for specified number of times.
Syntax:
for (initialized variable; condition; increment)
{
…code here
}
See PHP Code Example on For Loop
For each loop is used if the programmer want to execute codes that would loop through a block of arrays.
Syntax:
Foreach($array as $value)
{
…code here
}
See PHP Code Example on Foreach Loop
Are You Interested with PHP Programming?
Super
Yes
A Little Bit
No
See results without voting
Learn PHP Arrays
What is an Array? Array is used to declare or hold one or more values. If a variable can hold only one value an array can hold more. To use array in PHP, you will use the array() built in function. There are 3 kinds of Arrays in PHP, the Numeric Array, Associative Array and the known Multidimensional Array.
Numeric Array
This is an array which stores values in a numeric index.
Example:
$computers = array(“Apple”, “Toshiba”, “Lenovo”, “Acer”, “HP”);
All the values on the array is stored on a certain index respectively. The first value would be on the index 0. Meaning, the value “Apple” is on the index 0 or equivalent to
$computer[0] = “Apple”;
“Toshiba” is on the index 1 or equivalent to
$compter[1]=”Toshiba”; and so on.
See PHP code Sample on Numeric Array
Eye Moisturizer for Programmers
Murad Hydro Dynamic Ultimate Moisture for Eyes Set of 5 Sample Jars – $62 Value
Current Bid: $20.00
Associative Array
Associative array is used if you want to declare a value with associated value. For example:
$computer = array(“Apple” => “$500”, “Toshiba” => “$350”, “Acer” => “$200”, “HP” => “$200” );
See PHP Sample Code On Associative Array
Multidimensional Array
Multidimensional array is used to contain one or more arrays inside its body. For example:
$computer = array(“Apple” => array(“$500”, “$750”, “$1000”),
“Toshiba” => array(“$300”, “$350”, “$500”));
See Sample Code for Multidimensional Array
Dark Circles on Eye: Remedy for Computer Savvy
Bags, Dark Circles Under Eyes remedy, treatment, cure
Current Bid: $29.95
Functions in PHP
what is a function and how to make functions in PHP? To answer that, functions is a block code that will just be executed on the server if the function name is called. To make function on php, you must include the word “function” in every function you make.
Syntax:
function myFunctionName(with or without parameters here)
{
…code here
}
See an Example Code for Function
Protector Glasses For Computer Users
BLACK OR BROWN WAYFARER COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
Anti-Stress COMPUTER GLASSES Brown WAYFARER Eyeglasses clear sunglasses gunner
Current Bid: $7.95
BLACK OR BROWN WAYFARER COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
BLACK OR BROWN COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
BLACK OR BROWN COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
Other PHP Sample Codes and Tutorials
How to become a PHP Developer: Learn and Earn
How to run PHP Code or PHP Scripts and See the Result on Your Browser
HTML Basics: Learn The Basics of HTML and Create Your Own Webpage on Your Browser
PHP Code Example on Associative Array and Multidimensional Array
PHP Sample Codes On Function:How to make Function in PHP
PHP code Example for if statement
PHP Code Example for if-else Statement
PHP Code Example on if else-if Statement
PHP Code Example on Switch Statement
PHP Code Example on While Loop
PHP Code Example on Numeric Array
PHP Code Example on Do-while Loop
PHP Code Example on Foreach Loop and For Loop