未定义的常量名称假定为“名称”[重复]

This question already has an answer here:

I keep getting this error. Can someone please elaborate on what the solution might be?

PHP Notice: Use of undefined constant name - assumed 'name'

<?php foreach ($replacement_array as &$replacement_array) { ?>
    <option value="<?php echo $replacement_array[number]?>">
    <?php echo $replacement_array[name]?></option>
<?php } ?>

Original array code:

$replacement_array[] = array('name'=>'1) 200W High Bay (400W Subst.)', 'name_2'=>'200W High Bay', 'name_3'=>'High Bay', 'number'=>'1', 'replacement_cal'=>'200', 'life'=>'100000');
$replacement_array[] = array('name'=>'2) 80W High Bay (150W Subst.)', 'name_2'=>'80W High Bay', 'number'=>'2', 'name_3'=>'High Bay', 'replacement_cal'=>'80', 'life'=>'50000');
</div>

You need to make those array keys into strings. Like this:

<?php foreach ($replacement_array as &$replacement_array) { ?>
    <option value="<?php echo $replacement_array['number']?>">
    <?php echo $replacement_array['name']?></option>
<?php } ?>

Otherwise they are parsed as if they are code or global functions etc, but obviously there aren't any.