Laravel / August 19, 2014

Array – Dot Notation

Chris Pitt shows you how to setup your own dot notation for arrays by using Laravel as an example.

I like these and his example is a good one:

$config["app"]["cache"]["provider"] = "redis";

// Typical way:
if (!empty($config["app"]["cache"]["provider"])) {}

// compared to: 
$config->get("app.cache.provider", $default);

Laravel News Partners

Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.