How-to articles, tricks, and solutions about PHP
To install MySQLi on a Mac, you will first need to install the MySQL database server on your machine.
To install PHP Composer inside a Docker container, you will need to do the following:
To install the PHP intl extension on Ubuntu 14.04, follow these steps:
To install the php-redis extension using the official PHP Docker image, you can use the docker-php-ext-install script that comes with the image.
This is a short guideline that provides comprehensive information on how to decode a JSON string into an array with the help of PHP.
To automatically create a subdomain for each user in PHP, you can use the following steps:
In PHP, you can use the scandir() function to list the files and directories in a directory.
The location of the php.ini file depends on how you installed XAMPP.
With the help of this snippet, you can learn how to log errors and warnings in a file in PHP. Go ahead and check out the examples.
One way to make a countdown using PHP is to use the time() function, which returns the current timestamp, and subtract a future timestamp (representing the end date and time of the countdown) from it.
You can use the whereIn method on a query builder instance to create an "IN" clause for a given column and values.
In PHP, you can match whitespace, carriage return, and line feed using the following regular expression:
In this snippet, we demonstrate the simplest way of measuring the execution time of a string in PHP. Read on and check out the examples.
To minify HTML output in PHP, you can use the following steps:
In this short snippet, we will represent to you how to modify the session time out with the help of PHP functions.
There are a few different ways you can output a multi-level array in a human-readable format, depending on what you mean by "human-readable" and what you want to achieve.
In a jQuery AJAX request, you can output the response HTML data using the .html() method.
XML (Extensible Markup Language) is used to store and transport data. Learn how to accurately parse XML with PHP simpleXML library in this simple snippet.
In this short tutorial, you will find the way of passing an array in URL query string using PHP.
In PHP, arrays can be passed in the URL using the $_GET superglobal variable, but they need to be encoded first using the http_build_query() function.
You can pass a PHP variable's value to jQuery by using the PHP variable in a JavaScript script, and then accessing it with jQuery.
Working with variables is an essential part of a developer’s life. In this snippet, we will demonstrate to you how to pass variables by reference with PHP.
If you want to learn how to prevent SQL injection in PHP, as well as to get comprehensive information about SQL injections, you are in the right place.
To print a debug log in PHP, you can use the echo function to output a string to the web page or the print_r function to output the contents of a variable.
In PHP, you can use the $_SERVER superglobal array to access information about the current HTTP request.