M
M
Martovitskiy2020-10-10 15:20:19
CodeIgniter
Martovitskiy, 2020-10-10 15:20:19

How in php, Codeigniter to correctly get key value?

from the front I send serializeArray
Further in the controller I bring the key / value to the form

$answer = array();
            for ($i = 0; $i < count($this->request); $i++){

                $obj = array();
                $name = $this->request[$i]->name;
                $obj["$name"] = $this->request[$i]->value;
                array_push($answer, (object)$obj);
            }

I receive an array from objects
5f81a6a6b9b64427778168.png
how now to reach the necessary value?
$login_partners = array_search('login_partners', $answer);

It doesn't work like that

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question