current 返回数组中的当前值 &reftitle.description; mixedcurrent arrayobjectarray 每个数组中都有一个内部的指针指向它“当前的”单元,初始化时会指向该数组中的第一个值。 &reftitle.parameters; array 要操作的数组。 &reftitle.returnvalues; current 函数返回当前被内部指针指向的数组单元的值,并不移动指针。如果内部指针指向超出了单元列表的末端,current 将返回 &false;。 &return.falseproblem; &reftitle.changelog; &Version; &Description; &standard.changelog.calling-on-objects; &reftitle.examples; <function>current</function> 函数使用示例 ]]> &reftitle.notes; 在一个空数组上使用 current 函数,和在一个内部指针指向单元末端以外的数组上使用此函数,结果是相同的,同样都会返回 bool &false;。如果希望正确遍历一个包含 &false; 的数组,请参阅 &foreach; 控制结构。 如果仍然希望使用 current 来判断数组单元真实的值,应该同时使用 keycurrent 来检查当前元素是否为 &null;。 &reftitle.seealso; end key each prev reset next &foreach;