![]() |
The dot_array_search() function has strange behavior.
I am expecting a value that matches the key, or null if the key is not found. But PHP Code: dot_array_search('a.b.c', ['a' => ['b' => ['c' => 'c']) // return "c". Ok
I haven't really looked at it, but is the function expecting the user to at least provide an array with the correct number of levels? You'll have to wait for a CI4 to elaborate.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Find exact you must use function array_deep_search()
Code: array_deep_search('a.b.c', ['a' => ['b' => 'b']]); //return b
I don't know why.
I created an issue. https://github.com/codeigniter4/CodeIgni...ssues/5939 I concluded this is a bug, and sent a PR: https://github.com/codeigniter4/CodeIgniter4/pull/5940 |
Welcome Guest, Not a member yet? Register Sign In |