c# get index of array element code example
Example 1: c# find index element array
int[] arr = { 3, 6, 4, 1, 6, 8 };
// returns 1
Array.IndexOf(arr, 6);
Example 2: js get index of item in array
array.indexOf("item");
Example 3: get key of array element php
$people = array(
2 => array(
'name' => 'John',
'fav_color' => 'green'
),
5=> array(
'name' => 'Samuel',
'fav_color' => 'blue'
));
$found_key = array_search('blue', array_column($people, 'fav_color'));