Tag: php

  • Learn how to import a function() in PHP

    TIL*¹ you can import just a function in a .php file, like we do with classes. It works from PHP 5.6+, so there’s no weird compatibility issue. And it’s dead simple. Here’s an example from Safe PHP, specifically let’s say we want to use the safer*² version of json_decode. Pay attention at how this allows…