H
H
hollanditkzn2018-02-07 10:49:00
PHP
hollanditkzn, 2018-02-07 10:49:00

How to find value by array key?

I have the key but i need to know the value in the array how to write it. I only know array_search and array_keys but I need to do it in a different order

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad, 2018-02-07
@hollanditkzn

Isn't that right?

$array = ["hi", "world", "!"];
$i_know_index = 1;

echo $array[$i_know_index];

A
Ainur Valiev, 2018-02-07
@vaajnur

the question is not clear

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question