Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php access multidimensional array by string

function get_multi($arr, $str) {
    foreach (explode('.', $str) as $key) {
        if (!array_key_exists($key, $arr)) {
            return NULL; 
        }
        $arr = $arr[$key];
    }

    return $arr;
}
Comment

PREVIOUS NEXT
Code Example
Php :: wp_mail multiple recipients 
Php :: wpquery search taxonomy 
Php :: change apply coupon text woocommerce 
Php :: php file hash 
Php :: laravel search function 
Php :: laravel 8 livewire tutorial 
Php :: how to set 1 year date without saturday in while loop php 
Php :: only get selected value from has many ralation laravel 
Php :: Redirect to HTTPS & remove www 
Php :: unset method 
Php :: send image in request body laravel 6 
Php :: Using $this when not in object context 
Php :: string concatenation in php 
Php :: PHP OOP - Constructor 
Php :: check the existing image in s3 laravel 
Php :: laravel Pushing To Array Session Values 
Php :: 0 
Php :: which is file attributes in php 
Php :: insert javascript in php 
Php :: The Laravel installer requires PHP 7.3.0 or greater. Please use "composer create-project laravel/laravel" instead. 
Php :: magento Fatal error: Allowed memory size of 134217728 bytes exhausted 
Php :: how to separate admin and user login in laravel 
Php :: oop php 
Php :: laravel permissions package 
Php :: laravel relationship 
Php :: Basic HTTP Authentication example 
Php :: laravel rules 
Php :: laravel + join 2 eloquent queries 
Php :: Call to undefined function array_key_first() 
Php :: permission for multisite in wp-config.php file 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =