Join 25,000+ Laravel Developers and join the free Laravel Newsletter
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);

This appeared first on Laravel News

Visit Resource →

Laravel News Partners


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