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.
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.
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 […]
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 […]
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.
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.
Logical operators are true or false.
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 […]
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 […]
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