GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codin/dot-notation: super basic array dot notation access

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
spec/Codin/Dot
spec/Codin/Dot
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
composer.json
composer.json
 
 
license.txt
license.txt
 
 
phpspec.yml
phpspec.yml
 
 
phpstan.neon
phpstan.neon
 
 
readme.md
readme.md
 
 

Repository files navigation

Dot Notation Array Access

version workflow license

Fetching array items by dot notation

$dot = new Codin\Dot(['foo' => ['bar' => 'baz']]);

$dot->get() // ['foo' => ['bar' => 'baz']]
$dot->get('foo') // ['bar' => 'baz']
$dot->get('foo.bar') // 'baz'
$dot->get('foo.bar.qux') // null
$dot->get('foo.bar.qux', 'hello') // 'hello'
$dot->set('foo.bar', 'qux');
$dot->get() // ['foo' => ['bar' => 'qux']]

$dot->set('foo.bar.baz', 'qux'); // throws DotException the value at the index is not an array and wont be converted.
// Instead store the value as an array to overwrite
$dot->set('foo.bar', ['baz' => 'qux']);

About

super basic array dot notation access

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.