How-to articles, tricks, and solutions about PHP
proper way to logout from a session in PHP
To properly log out of a session in PHP, you can use the session_destroy() function.
Redirect with CodeIgniter
In CodeIgniter, you can use the redirect() function to redirect the user's browser to a new page.
Redirecting to authentication dialog - "An error occurred. Please try again later"
This message typically indicates that there is an issue with the authentication process.
Reference — What does this symbol mean in PHP?
In PHP, $this is a special variable that refers to the current object.
ReflectionException: Class ClassName does not exist - Laravel
This error message indicates that Laravel is trying to use a class that it can't find.
reliable user browser detection with php
There are several ways to detect a user's browser using PHP.
Remote file size without downloading file
In PHP, you can use the get_headers() function to retrieve the headers of a remote file.
Remove all non-numeric characters from a string; [^0-9] doesn't match as expected
You can use the preg_replace function in PHP to remove all non-numeric characters from a string.
Remove control characters from PHP string
In PHP, you can use the preg_replace function to remove control characters from a string.
Remove portion of a string after a certain character
There are several ways you can remove a portion of a string after a certain character in PHP.
Remove trailing delimiting character from a delimited string
To remove the trailing delimiter from a delimited string in PHP, you can use the rtrim function.
Resetting MySQL Root Password with XAMPP on Localhost
To reset the root password for MySQL on XAMPP, you can follow these steps.