$array = array(
array(
'key1',
'text 1 text 1 text 1'
),
array(
'key2',
'text 2 text 2 text 2'
),
array(
'key3',
'text 3 text 3 text 3'
)
);
Sorry for the title, its quite hard to explain without an example.
The user want to read some text. For example, the text of key2. So when the input is key2, i want to display the text: text 2 text 2 text 2.
But how can i select that text using PHP?
If you can, I think using the key’s as actual key’s in the array:
If you cannot manipulate the array, you can use a loop to create an array as described above:
This only works if you are sure that the key is always the first element and the text the second.