Answers for "how to find index value of an array php"

PHP
6

get index of element in array php

$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');

$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array);   // $key = 1;
Posted by: Guest on September-24-2020
2

array search by key in php

$arr = array(
    "one" => 1,
    "two" => 2,
    "three" => 3,
    "seventee
Posted by: Guest on November-04-2020

Code answers related to "how to find index value of an array php"

Browse Popular Code Answers by Language