How-to articles, tricks, and solutions about PHP
How can I detect if the user is on localhost in PHP?
You can use the $_SERVER['HTTP_HOST'] variable to detect if the user is on localhost in PHP.
Check if all values in array are the same
In PHP, you can use the array_unique function to check if all values in an array are the same.
Getting ’ instead of an apostrophe(') in PHP
This can occur if your PHP code is using the ISO-8859-1 character set instead of UTF-8.
How to add text to an image with PHP GD library
Here is an example of how you can add text to an image using the PHP GD library:
Convert plain text URLs into HTML hyperlinks in PHP
You can use the preg_replace() function in PHP to convert plain text URLs into HTML hyperlinks.
file_put_contents and a new line help
file_put_contents is a PHP function that writes a string to a file.
PHP's file_exists() will not work for me?
The file_exists() function in PHP can be used to check if a file exists on the file system.
Laravel storage link won't work on production
There are several reasons why the Laravel storage link may not be working on production.