How to select a specific record from an array

1

Personal I have the following problem. I dynamically created an array to receive some information. selections [2]{"2","alt-2-2"} [7]{"3","alt-7-3"} [8]{"1","alt-8-1"}

Well, in the key I write the id in the database of that record, then the option chosen between 1 and 3 is registered and in the last one the id of the div that was chosen. You may notice that the id of the div is composed of "alt-id_no_mysql-chosen_choice". But now let's say that only option 3 is correct, only the 7 key is right, and the others are wrong. How do I navigate the array searching for the correct one? I know if the keys were sequential type 0,1,2 ... one was already solved, how do I then in that case?

    
asked by anonymous 06.06.2018 / 13:52

0 answers