我将只声明一次数组。价值想要一次又一次地作为关键别名来调用。请任何人都可以帮助我? 例如:PHP数组变量声明为别名
我:
<?php
$id = $profile[0]->id;
$roll = $profile[0]->roll;
$photo = $profile[0]->photo;
$active = $profile[0]->active;
?>
我neeed:
<?php
$var as $profile[0];
$id = $var->id;
$roll = $var->roll;
$photo = $var->photo;
$active = $var->active;
?>
它可以用foreach()来完成。但是,我想在Alias上工作。 我需要什么好的想法..