Wow. I just spent a few hours debugging a problem with my PHP file upload. Turns out the fix was to include an ‘id’ attribute on the file input element. Have no idea why that is required or works, but it does.
Tag Archives: php
Configuring PHP with php.ini
There’s some good info about common config options over here: Where Is php.ini, the PHP Configuration File?
The phpinfo()
function will tell you which php.ini file applies.
phpSysInfo
I stumbled upon phpSysInfo, a PHP library for system information. Haven’t actually used it, yet.
Modern PHP
Some notes on features in Modern PHP.
Arrays in PHP
Some notes about arrays in PHP over here: PHP: Frankenstein arrays. I was already aware of most of that but I thought the notes at the bottom about supporting JSON were handy:
If you want to enforce an array to encode to a JSON list (all array keys will be discarded), use:
json_encode(array_values($array));
And if you want to enforce an array to encode to a JSON object, use:
json_encode((object)$array);
Also array_is_list is available as of PHP 8.1.
PDOStatement::fetchAll()
I’m reading the source code for PDOStatement::fetchAll().
sizeof PHP data structures zval and zend_value
sizeof( zval ) == 16; sizeof( zend_value ) == 8;
PHP 8.0
PHP 8.0 release notes: PHP 8.0
PHP type comparison tables and tokens
This is handy: PHP type comparison tables.
And this is interesting: List of Parser Tokens.