使用带有字符串文字的混合变量

How would I check if the variable label_$value exists?

E.g:

<?php foreach($status_values as $value => $label){ ?>
    <input type="radio" name="status" value="<?php echo $value; ?>" <?php if($status == $value){ echo ' checked="checked"'; }?> />
    <?php echo (isset("label_{$value}")) ? "label_{$value}" : $label; ?>
<?php } ?>

This gives error: Parse error: syntax error, unexpected '"' for the isset

But I dont get any syntax error when I have:

<?php echo ("label_{$value}") ? "label_{$value}" : $label; ?>

So I want to:

  1. Check if the variable exists: $label_foo
  2. use the default $label

you have to use variable variables. use

<?php
$label_test = "Hello";
$value = "test";
echo (isset(${"label_{$value}"})) ? "label_{$value}" : $label;
?>

That's not how you compile the variable name. Try isset(${"label_$value"});