Online Programming Tutorials | Web Tutorials | PHP Tutorials

PHP While Loop

The PHP while loop is used to repeat the code inside the while loop a specific number of times. The conditional statement decides the number of iterations of the code. If the condition is TRUE, the while loop continues to execute the code, and if the condition is FALSE, the control move outside of the while loop. Read More

PHP For Loop

Unlike the while loop, the for loop is used when you know beforehand how many times you want to execute the codes. The loop is terminated once the number of iterations surpasses the maximum number specified. Here is how it works. Read More

PHP If else

The core functionality of PHP can evaluate expressions and perform an action based on the results, and If statements are a simple way to do that. If statement is the most basic conditional statement in PHP, it is like the English language sentence "If this happens, do that." It works like this. Read More

PHP Comments

As a programmer, it is good practice to write well-documented code that can be read months later by you or any other developer. It simply makes a developer's life easier who wants to make some changes or a few updates on your code. Read More

PHP Variables

Variables are used to store simple values, complex data, or HTML code to use later in the program. Unlike many other languages, the variable does need to be declared explicitly before assigning a value to it. Once assigned a value, you can use a variable throughout your script. Read More

PHP Constants

The constants are identifiers in PHP used to define global data. If a script requires a global value that should be accessed from any scope, a constant can be used to define these. It is created using the define() function and can be assigned any fixed value. Once the "constant" is defined, the value cannot be changed during the script execution. Hence the value remains unchanged during the lifespan of the script execution. Read More

PHP Echo and Print

The PHP echo and print statement display the output of the variable’s values to the browser. The echo statement is a language construct and does not return a value. Therefore, using it as a function is unnecessary, and no parentheses are needed. You can use echo to print multiple string values separated by a comma.  Read More

PHP Syntax

A PHP code block must be written inside the PHP opening and closing tags () called Canonical PHP tags. The start tag tells the PHP parser to begin parsing, and the closing tag tells to end the parsing. The PHP can be embedded within the HTML code, and anything outside the PHP opening and closing tags will be treated as HTML code. The PHP code can be embedded with HTML code, and the file must be saved with a PHP extension. Read More

Python Regex

Regex stands for Regular Expression, which is a very powerful technique for searching a piece of text in a text document. Using Regex, we define an expression based on the pattern that the required text in the document follows. This is much more powerful than the usual way of finding text by just searching for a specific string. The latter is very limited. Read More

Python - Classes/Objects

In object-oriented programming, a class encapsulates real-life complexity and makes it simple for reuse, and a programmer creates objects based on these classes. When you create an object from a class, it automatically inherits the traits of the class, and new methods and behaviours can be added to the object. Read More

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies Find out more here