How-to articles, tricks, and solutions about PHP
To create a virtual host on XAMPP, follow these steps:
To include external CSS and JavaScript files in a Laravel 5 application, you can use the asset helper function.
The pluck method is used to retrieve a list of a single column from a database table.
To find the day of the week in PHP in a specific timezone, you can use the date function and specify the timezone using the date_default_timezone_set function.
To get the URL of a file using the Storage facade in Laravel 5, you can use the url method.
The exec(), system(), and passthru() functions are all used to execute external programs in PHP.
To remove excess whitespace from within a string in PHP, you can use the preg_replace() function with a regular expression that matches any sequence of one or more whitespace characters.
To get the last inserted ID using PDO, you can use the PDO::lastInsertId() method after inserting a row into the database.
To select data from a MySQL database based on the month and year, you can use the MONTH and YEAR functions in your SELECT statement.
It looks like you are trying to access a property of an object that has not been defined.
In PHP, you can use the finfo_file function to determine the MIME type of a file.
To parse the domain from a URL in PHP, you can use the parse_url function, which will return an associative array containing information about the URL.
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.
There are a few possible reasons that json_decode() might return NULL when given what appears to be valid JSON.
This error message in Codeigniter indicates that you are attempting to return a variable by reference, but only variable references can be returned by reference.
Here's an example of how you can implement Long Polling in PHP:
To install MySQLi on a Mac, you will first need to install the MySQL database server on your machine.
In Laravel, you can use the validate method on the Validator facade to validate an array of form data.
To check if an array is associative or sequential in PHP, you can use the array_keys() function and compare the resulting array of keys with the original array.
This error message indicates that there was a problem connecting to the MySQL database with the provided credentials.
To pass a username and password to the SMTP server in the php.ini file, you can use the following format:
To get the query executed in Laravel 5, you can use the DB::getQueryLog() method.
There are a few things you can try if you are having trouble starting Apache in XAMPP on Windows 10:
You can use the set_time_limit() function in PHP to increase the maximum execution time of a PHP script.
I'm sorry to hear that you're having trouble installing PHP on your Ubuntu 16.04 system.