How-to articles, tricks, and solutions about PHP
How to get the first day of the current year?
In PHP, you can use the mktime function to get the Unix timestamp of the first day of the current year, then use the date function to format it as a date string.
How to pass an array via $_GET in php?
In PHP, arrays can be passed in the URL using the $_GET superglobal variable, but they need to be encoded first using the http_build_query() function.
Symfony error The class XXX was not found in the chain configured namespaces XXX
This error message is indicating that the Symfony framework is unable to find a specific class within the namespaces that have been configured.
UTF8 Encoding problem - With good examples
UTF-8 is a character encoding that represents each character in a text document as a unique numerical code.
Get All simple product from a Configurable Product in Magento Product View
In Magento, a configurable product is made up of multiple simple products, each with different options such as size or color.
PHP How to add to end of array?
In PHP, you can add an element to the end of an array using the array_push() function.
get array of rows with mysqli result
You can use the mysqli_fetch_assoc() function to retrieve an associative array of a single row from a result set, and use a loop to iterate through the result set and store each row in an array.
Generating cryptographically secure tokens
In PHP, you can use the built-in function random_bytes() to generate cryptographically secure random bytes, which can then be converted into a token.
Update PHP to 7.4 macOS Catalina with brew
To update PHP to version 7.4 on macOS Catalina using Homebrew, you can use the following steps: