How-to articles, tricks, and solutions about PHP
json_decode to custom class
In PHP, you can use the json_decode() function to convert a JSON string into a PHP object or array.
Remove control characters from PHP string
In PHP, you can use the preg_replace function to remove control characters from a string.
Why can't PHP create a directory with 777 permissions?
PHP's mkdir() function, which is used to create a new directory, defaults to using the server's current umask setting when determining the permissions of the newly created directory.
Use cURL with SNI (Server Name Indication)
Server Name Indication (SNI) is an extension to the Transport Layer Security (TLS) protocol that allows a client to specify the hostname it is trying to connect to at the start of the handshaking process.
How to check if a row exist in the database using PDO?
You can use the rowCount() method of the PDOStatement object to check if a row exists in the database using PDO.
Queued Laravel jobs all fire simultaneously, and don't show up in the jobs table
How to implement 'Token Based Authentication' securely in PHPFox?
Here is a general outline of how to implement token-based authentication in PHPFox:
How to pass php variable's value to jquery
XML Parse Error - Extra content at the end of the document
This error message typically occurs when there is additional content or characters after the closing root element in an XML document.