Chrome Extension

Get values array by key name using array_column() PHP

You can get an array of values by key name from an associative array using the array_column() function PHP
<?php
    $employees = array(
        array(
            'emp_name' => 'Rick Grimes',
            'designation' => 'developer'
        ),
        array(
            'emp_name' => 'John Wick',
            'designation' => 'manager'
        )
    );

    $designations = array_column($employees, 'designation');
    print_r($designations);
?>
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

Search Index Data (The code snippet can also be found with below search text)

array_column() PHP
Was this helpful?
0 Comments
Open Code Manager We are hiring