what is the correct syntax to use isset with a dynamic variable name and dynamic key name, without writing the keyname in braces.
Example:
$ab[0] = 'test';
$var1="ab";
$var2="[0]";
$var3="0";
//This works
if (isset(${$var1}[0])){
echo "success";
}
//This works too
if (isset(${$var1}[$var3])){
echo "success";
}
//But this doesn't.
if (isset(${$var1}$var2)){
echo "success";
}
What can I do that the 3rd example works? I can't use the first or second example, because I dont't know how many subarrays are inside the array.