basics

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 }

PHP For Loop

by Hiroshi on June 21, 2008

in For Loop, Loops, PHP Basics

For loop consists of three phases. i.e. Define Condition Increment or decrement First we define something. Then we apply a condition and then under that condition we increment or decrement that defined thing. In complex way; – The first part is an expression that is evaluated once when the loop begins. – The second part […]

{ 1 comment }

Some of the most frequently used code in PHP or any programming language is the code that will increment or decrement the value of a variable. This code or expression is used in programs as simple as a page counter or as complicated as credit card processing. decrement() decrements value of the item by value. […]

{ 0 comments }

Some of the most frequently used code in PHP or any programming language is the code that will increment or decrement the value of a variable. This code or expression is used in programs as simple as a page counter or as complicated as credit card processing. increment() increments value of the item by value. […]

{ 0 comments }

With the use of the switch statement you can check for many conditions at once, and the great thing is that it is actually more efficient programming to do this. A true win-win situation! The way the Switch statement works is it takes a single variable as input and then checks it against all the […]

{ 0 comments }

If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.

{ 0 comments }

Print in PHP

by Hiroshi on June 19, 2008

in PHP Basics, Print

Print is almost similar to echo in PHP. Here is how we do it.

{ 0 comments }

Here is PHP prefix example.

{ 0 comments }

Use this example to show some hidden message at page using PHP. You can use two pages for that or single page if register_globals are on in your php.ini settings.

{ 0 comments }

PHP info outputs lots of PHP information installed at your server. Create the following script file and upload it at your server to see all about PHP software installed there. < ?php phpinfo(); ?> And there is more to that…

{ 1 comment }