A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
| var_dump(json_encode( | |
| array() | |
| )); | |
| // [ ] | |
| var_dump(json_encode( | |
| array('foo') | |
| )); | |
| // ["foo"] |
| function print_pre($var, $doDie = true) { | |
| echo "<pre>"; | |
| print_r($var); | |
| echo "</pre>"; | |
| if ($doDie) { | |
| die('i-die'); | |
| } | |
| } |
| <?php | |
| $tests = array( | |
| array('{"test":""}', 2), | |
| array('{"test": {}}', 3), | |
| array('{"test": {}, "test2": ""}', 3), | |
| array('{"test": {}, "test2": {}}', 3), | |
| array('{"test": {}, "test2": {"test3": ""}}', 3), | |
| array('{"test": {}, "test2": {"test3": {}}}', 4), |
A list of amazingly awesome PHP libraries, resources and shiny things.
| <?php | |
| /** | |
| * Class casting | |
| * | |
| * @param string|object $destination | |
| * @param object $sourceObject | |
| * @return object | |
| */ | |
| function cast_long($destination, $sourceObject) |