How-to articles, tricks, and solutions about PHP
On this page, we are going to provide you with comprehensive information about a common PHP issue: how to split a comma delimited string into an array.
In PHP, an ampersand is put before the function name for returning a reference to the variable instead of returning the value. Learn how to do that, here.
To store the file name in a database along with other information while uploading an image to a server using PHP, you can follow these steps:
If you want to get the best solution to how to strip all spaces out of a string in PHP, you are in the right place. Read the snippet and choose your option.
To send email using Gmail in Laravel, you can use the built-in Swift Mailer library.
To truncate a string in PHP to the word closest to a certain number of characters, you can use the following code:
In PHP, notices are known as “soft errors”. However, at times developers want to turn them off. Here, we will show you how to act to turn off PHP notices.
To upload a file using cURL in PHP, you can use the curl_setopt function to specify the CURLOPT_POSTFIELDS option with the file data.
To upload files directly into the public folder in Laravel, you can use the storeAs method provided by the Storage facade.
In this snippet, you will figure out how to use the "or" operator in a switch case in PHP. Read on, check out and try the examples.
There is a password hashing technique, used for building the security of passwords. It is called bcrypt. Here, you will learn how to use it in PHP.
Here, we will demonstrate how to use standard callbacks, static class method callbacks, object method callbacks, as well as closure callbacks in PHP.
The continue and break keywords are used to control the whole program flow. This snippet will show you examples of how to use these keywords in PHP.
While working with PHP, every developer should know how to use echo, print, as well as print_r. Read our snippet to learn about these crucial parts of PHP.
Using multiple databases in Laravel is quite easy.
You can use the implode() function to convert the PHP array into a string of comma-separated values, and then use that string in the SQL query with the IN operator.
This tutorial can be quite helpful for you, if you are interested in using the PHP serialize() and unserialized() functions in your programming practice.
setInterval is a JavaScript function and cannot be used directly in PHP.
In PHP 5.3.0, you can use the hash function to create a SHA-256 hash.
The @ sign is one of the common used ones in programming. Let’s discover how it can be used in PHP together. Read on the snippet and check the examples.
Logical operators are supported by PHP. Let’s explore how to use one of the most commonly used logical operators in PHP: AND.
The double Not(!!) or the NOT NOT is one of the commonly used operators in PHP. Here, we will show you what it is and how to use it in your practice.
In this snippet, you will find comprehensive and helpful guidelines on how to use the expm1() function in PHP.
Let’s dive deeper into the world of PHP. Here, we are going to discover the filter_var() function. Let’s see for what purposes it can be used in PHP.