How-to articles, tricks, and solutions about PHP
If you wonder how to find a proper way of converting MySQL data to JSON format using PHP, then you are in the right place. Read on and check the example.
To convert seconds to a time format in PHP, you can use the date function and specify the format you want to use.
While working with arrays, it is commonly necessary to count all its elements. This snippet will discover two helpful functions that will help you do that.
In Yii2, you can use the count() and groupBy() methods in the query builder to count and group the results of a query, respectively.
You can use the DateTime class in PHP to calculate the number of days between two dates.
PHP provides a range of extensions and functions for getting the number of pages in a PDF document. Let’s check out the most efficient ones, here.
To create a foreign key in PHPMyAdmin, follow these steps:
Here, we will share with you how to create a jQuery Ajax post request with PHP. Just check out the examples and choose the one that suits your needs best.
In this snippet, we are going to describe how to create a new line with the help of the PHP arsenal. Go ahead and learn how to do it easily.
To create and download a CSV file from a PHP script, you can use the following steps:
JSON is a data-interchange format, which can be generated and parsed by PHP or other programming languages. See how to create and parse JSON data by PHP.
In PHP, you can create a new property for an object dynamically by using the magic method __set.
Here is a short tutorial that will represent to you the way of creating a URL slug from string with PHP. It should be an essential part of any website.
To create a virtual column using a MySQL SELECT statement, you can use the AS keyword to assign a name to an expression in the SELECT statement.
To create a virtual host on XAMPP, follow these steps:
Here is a snippet that will help you to deal with a common PHP undefined offset error. Here, you will find three methods that help to avoid such an error.
In PHP, you can use the utf8_decode() function to decode a string that contains Unicode escape sequences.
In this short tutorial, you will find the most proper solution to the commonly asked question by programmers: how to delete an element from an array.
You can use the destroy() method in Laravel Eloquent to delete multiple records.
Browser detection is used to determine the web browser a visitor is using and to serve browser-appropriate content to the visitor. Know how to do it with PHP.
In this snippet, we are going to figure out how to successfully determine the first and last iteration in a foreach loop with the help of PHP.
In PHP, you can disable output buffering by calling the ob_end_flush() function or flush() function.
To disable registration of new users in Laravel, you can remove the registration routes from the web.php file in the routes folder.
You can use the date() function in PHP to display a date in ISO 8601 format.
Often errors occur while executing a PHP application. Read this snippet to learn how to overcome difficulties and display such errors with the help of PHP.