Foreach loop (or do while maybe?) - Want to return only one record depending on page

丶灬走出姿态 提交于 2019-12-02 01:00:51

If you don't know the key and want the current element of the array, you could use:

$challengename = current($this->challengenames);

Or the first element of the array:

$challengename = reset($this->challengenames);

Or the last element of the array:

$challengename = end($this->challengenames);

Just note that end and reset will change the pointer location of the array.

 <?php $challengename = $this->challengenames[0] ?> 

You are missing a last ; try add it agaign; try below:

  <?php $challengename = $this->challengenames[0]; ?> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!