I have a php array output like this
Array (
[DISEASE] => Array ( [0] => DM [1] => HT )
[DRUG] => Array ( [0] => INSULIN [1] => DIURETIC)
)
Now I want to print the following
For Disease DM, INSULIN is used
For Disease HT, DIURETIC is used
i.e I want to match the value from array Disease with that of Drug.
Please help me.
Edit
I could not find a “thanks” button here. Thank you all for your help.
Why don’t you use the keys in an array? http://php.net/manual/en/language.types.array.php (see example one)
Then the array would look like:
And you could call it like: