Saturday, 23 September 2017

String Concept in PHP

String-

A string is a sequence of characters. Here, the example of "Double-Quoted" and "Single-Quoted" string are enclosed here as well as many of the built-in functions of Strings are explained with examples.

Consider the following example -


The code of the above page, is as follows -



When I click on "Double-Quoted String", the output is as follows - 

The code of the above page is as follows - 


When I click on "Single-Quoted String", the output is as follows -

The code of the above page is as follows -


When I click on "Echo", the output is as follows -

The code of the above page is as follows -


When I click on "Print() Function", the output is as follows -


The code of the above page is as follows -


When I click on "Printf() Function", the output is as follows -

The code of the above page is as follows -


When I click on "Print_r", the output is as follows -

The code of the above page is as follows -


When I click on "Var_Dump Function", the output is as follows -

The code of the above page is as follows -


When I click on "Strlen", the output is as follows -


The code of the above page is as follows -


When I click on "Changing Case", the output is as follows -

The code of the above page is as follows -


When I click on "HTML Special Characters", the output is as follows -

The code of the above page is as follows -


When I click on "Strip Tags", the output is as follows -


The code of the above page is as follows -


When I click on "Implode", the output is as follows -

The code of the above page is as follows -


When I click on "Explode", the output is as follows -


The code of the above page is as follows -


When I click on "Exact Comparison", the output is as follows -

The code of the above page is as follows -


When I click on "Sub String", the output is as follows -


The code of the above page is as follows -


When I click on "String Replace", the output is as follows -


The code of the above page is as follows -


When I click on "String Reverse", the output is as follows -

The code of the above page is as follows -


When I click on "String Position", the output is as follows -

The code of the above page is as follows -


When I click on "String Search", the output is as follows -


The code of the above page is as follows -


Monday, 18 September 2017

PHP Functions

Function
  • A function is a named block of code that performs a specific task.
  • Functions are compiled only once for the page.
  • They improve readability by isolating code that performs specific tasks.

Now, analyse all the concepts of Function in PHP with a suitable example. Consider the follow output:-


The code of the above page is as follows:-



When  I will click on "Default Argument", the output will be as follows:


The code of the above page is as follows:-


When  I will click on "Passing Two Arguments", the output will be as follows:


The code of the above page is as follows:-



When  I will click on "Function Argument", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Variable Scope", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Global Scope", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Call By Value", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Call By Reference", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Static Variable", the output will be as follows:

The code of the above page is as follows:-


When  I will click on "Variable Functions", the output will be as follows:

The code of the above page is as follows:-