PHP Basics

Recently I was working with some PHP project and I had to fetch some text from database but I did not want to show all the paragraph. Instead I wanted to display just some part of it and give the reader facility to have a link or read more. For example: If the original text […]

{ 0 comments }

PHP Post And Get

by Hiroshi on June 23, 2008

in PHP Basics, Post & Get

Post and Get are both used in forms to pass data from one page to another but there is a slight difference in both. Consider we have a form containing user name and password fields. On submit it goes to page named as submit.php. Now the behavior of form with these two get and post […]

{ 0 comments }

PHP Arrays

by Hiroshi on June 23, 2008

in Arrays, PHP Basics

An array is a data structure that stores one or more values in a single value. In more detail ‘An array’ in PHP is actually an ordered map. A map is a type that maps values to keys. This type is optimized in several ways, so you can use it as a real array, or […]

{ 0 comments }

PHP Strings

by Hiroshi on June 22, 2008

in PHP Basics, Strings

Before you can use a string you have to create it! A string can be used directly in a function or it can be stored in a variable. Below we create the exact same string twice: first storing it into a variable and in the second case we place the string directly into a function.

{ 0 comments }

Variable Scope The scope of a variable is the context within which it is defined. For the most part all PHP variables only have a single or local scope. This single scope spans included and required files as well.

{ 0 comments }

Logical operators are true or false.

{ 0 comments }

PHP Functions

by Hiroshi on June 21, 2008

in PHP Basics, PHP Functions

A function is just a name we give to a block of code that can be executed whenever we need it. This might not seem like that big of an idea, but believe me, when you understand and use functions you will be able to save a ton of time and write code that is […]

{ 0 comments }

PHP provides an easy way to use every element of an array with the For each statement. For each executes the code at each item in the specified array. While a For Loop and While Loop will continue until some condition fails, the For Each loop will continue until it has gone through every item […]

{ 0 comments }

A “do while” loop is a slightly modified version of the while loop. A do-while loop first do’s and secondly checks the while condition! PHP Do While Loop Structure – Define – Do – Print – Increment or decrement – Condition

{ 0 comments }

PHP While Loop

by Hiroshi on June 21, 2008

in Loops, PHP Basics, While Loop

The while keyword takes a condition in parentheses, and the code block that follows is repeated while that condition is true. If the condition is false initially, the code block will not be repeated at all. The repeating code must perform some action that affects the condition in such a way that the loop condition […]

{ 1 comment }