Why did nobody tell me about this function? I've been converting objects to arrays for years in order to use Arr::get(). This changes everything 🙈

The data_get function retrieves a value from a nested array or object using "dot" notation:

$data = ['products' => ['desk' => ['price' => 100]]];

$price = data_get($data, 'products.desk.price');

// 100
continue reading on x.com

⚠️ This post links to an external website. ⚠️