PHP 对象变量变量名称?
2022-08-30 17:23:42
我有一个从1到10的循环,并将值打印在
$entity_object->field_question_1
通过10所以...
$entity_object->field_question_1
等$entity_object->field_question_2
我想在这个循环中打印这个,我该如何获取变量?我尝试做
$var = "entity_object->field_question_".$i;
print $$var;
但这并没有奏效...
如何获取这些值?