SaveSnippets
Community
Pricing
Sign In
Get Started
Community
Public Snippets
2
Code shared by the SaveSnippets community — browse, copy, and get inspired.
All Languages
Bash
Go
HTML
Java
JavaScript
Kotlin
PHP
Python
Rust
SQL
TypeScript
#dot-path
Clear
Tags
#php
#kotlin
#bash
#go
#sql
#rust
#typescript
#html
#java
#python
#files
#utils
#strings
#http
#concurrency
#async
#json
#arrays
#security
#types
#crypto
#database
#dates
#format
PHP
Set Nested Value by Dot Path
Mutate a nested array by dot path, auto-creating any intermediate arrays. Companion to getPath; together they replace a lot of isset+array_key_exists ladders.
#php
#arrays
#dot-path
#nested
PHP
Get Nested Value by Dot Path
Read deeply-nested array values like Lodash _.get(). Use a "a.b.c" string instead of nested isset checks; returns a default on any missing segment.
#php
#arrays
#dot-path
#nested
#lodash