Online Programming Tutorials | Web Tutorials | PHP Tutorials

Python String casefold() Method

The Python casefold() function works as a stronger version of Python’s lower() function, i.e. it has the same functionality of returning a lowercased copy of the given string, but it takes the method one step further by being more aggressive, which is shown by its lowercasing of character beyond the ASCII accepted characters. It even ignores the case of the given string, making it preferable to handle caseless string matching. Read More

Python String find() Method

The Python find() method searches the given string argument in the subject string and returns the lowest index position of the occurrence of the string within another string. Read More

Converting List to String in Python

Here, I will discuss how a list can be converted to a string in Python. Python has many ways of converting a list data type to a string data type of Python. A straightforward method will be to iterate through the list and concatenate each element to an empty string. First, you have to create a List, then an empty string to store the List values. Each element of the list is accessed through For loop and appended to the string using the += operator. Finally, the string is printed. Read More

PHP Break statement

The PHP break statement is used to end a loop prematurely by inserting the break keyword inside a conditional statement. As the interpreter finds the break, it terminates the loop, and execution is passed to code next to the current loop. The break statement works for all the PHP loops, i.e., Do..while, while, for loop, foreach loop, etc. Read More

PHP Continue Statement

When we want to skip to the next iteration of the loop that is currently being executed, we use the continue statement. Thus, whenever the control reaches the continue statement, the loop being executed skips the current iteration, and the control goes to the following iteration. Read More

PHP Cookie

The Cookie is a set of information saved by the website script on the user's computer. Cookie data is automatically sent to the server with the request's header whenever a user visits a page. The server sends data to the browser, and the browser saves them into a temporary file on the computer's hard disk. The data even persists when the user's computer is switched off. A cookie is ideal for storing small amounts of data on a user's computer. It is not for storing a large amount of user data or keeping sensitive information. Read More

PHP Sessions

The session is another way of storing the user's temporary data on the server. Unlike cookies, the session stores data on the server with a short session ID string with the data. The server sends a cookie with the string ID to the browser in response to a request. When the browser requests a page from the website, the cookie with string ID goes back to the server, and then your PHP script can access the session data. As a developer, you specifically store the user's information on the database server to use them later in your application, but sometimes you need temporary data fields to send across the website's pages, and one way of saving temporary data is the cookie discussed in an earlier tutorial. Read More

PHP Null Coalescing Operator

A Null coalescing operator is used when you are unsure whether you have set the value of an element or not. So, in this case, it will print a value not set instead of giving an error that $m is not defined if we used the ternary operator. Read More

PHP Ternary operator

Ternary operator conditional operators are used for executing code if a given statement is true or false. Ternary conditional operators are used to reduce space used by if-else statements. Read More

PHP Comparison Operators

PHP Comparison operators are used to compare the values of two elements and return a boolean result. Comparison operators supported by PHP are ==,!=,<,>,<=,>=. Read More

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