Category: PHP Basics

PHP Loops

Loops are used to run the same lines of code for multiple times. If we want to execute same code multiple times then we can put it into a loop block to avoid code...

PHP Constants Example

PHP contains some special constants named as magic constants. These magic constants are not actually constants because of revealing with different values based on the place they are used. The magic constants are case-insensitive. Defining...

PHP Print echo Statements

PHP Functions used for Printing Data print() – The print() is used to create PHP print statement to print given data to the browser. It accepts single data and prints it on the browser. It is a PHP...

PHP Hello World

Example Hello World Code using Echo <?php echo “Hello, World!”; ?> Example Hello World Code using Print <?php print “Hello, World!”; ?> In this context of printing ‘Hello, World!’, both ‘echo’ and ‘print’ are...

PHP Single Multi-line Comments

Single line comment The (//) or hash(#) characters are used to add single line comments. Single line comment can also be referred as the inline comment. We have an example code to add single line...

PHP Redirect Location url

PHP Redirect Syntax header(“Location: target-url”); In the above syntax of PHP redirect, we need to replace with a valid URL to which we want to move. We can specify either absolute URL or relative...

PHP If Else Statement Example code

PHP if Statement This statement includes a single line or a bunch of code enclosed in curly braces, on which the if condition will be applied. We can refer the following code for an example of PHP if statement. $title...

PHP unlink() and unset()

unlink() in PHP PHP unlink() functions are used to delete a file within a directory completely on successful execution, Rather, it causes PHP warning error. The possibilities for error occurrences are, if we are not having...

foreach Usage in PHP Script

foreach Usage in PHP Script We can use foreach statement in a PHP program with two various syntaxes differed based on the iteration behavior for getting array elements in the following type of ways. For getting only...

Operations Performed using PHP NameSpaces

Operations Performed using PHP NameSpaces With PHP namespaces, we can have the following operations listed below. Grouping related PHP code blocks into one scope or space to refer in future. Creating functions or classes...

Show Buttons
Hide Buttons
Social Media Auto Publish Powered By : XYZScripts.com