basics

I have three solutions here to find current page name or URL of page being displayed. This script can be useful while you want to get page name or send page URL via email. If the page name is url.php and it is in wamp www directory i.e. localhost, then consider this example.

{ 0 comments }

String to Upper Case – strtoupper The strtoupper function takes one argument, the string you want converted to upper case and returns the converted string. Only letters of the alphabet are changed, numbers will remain the same.

{ 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 }