How-to articles, tricks, and solutions about PHP
How can I trim all strings in an Array?
You can use the array_map() function to trim all strings in an array in PHP.
How can I write a file in UTF-8 format?
To write a file in UTF-8 encoding with PHP, you can use the fopen, fwrite, and fclose functions.
How do I add PHP code/file to HTML(.html) files?
To add PHP code to an HTML file, you will need to use PHP tags.
How do I create a copy of an object in PHP?
In PHP, you can create a copy of an object using the clone keyword.
How do I implement basic "Long Polling"?
Here's an example of how you can implement Long Polling in PHP:
How do I install Composer on a shared hosting?
To install Composer on a shared hosting, you can use the following steps:
How do I PHP-unserialize a jQuery-serialized form?
In PHP, you can use the unserialize function to unserialize a serialized string.
How do I remove the last comma from a string using PHP?
To remove the last comma from a string in PHP, you can use the rtrim function.
How do I return a proper success/error message for JQuery .ajax() using PHP?
To return a proper success/error message for jQuery.ajax() using PHP, you can do the following: