“调用未定义函数array_key_last()”,尽管它是在本地工作的PHP函数

时间:2019-07-12 13:27:18

标签: php codeigniter error-handling php-7.3

我制作了一个在本地完美运作的网站。 现在,我尝试通过ploi.io在线发布它。 我收到此错误:

  

“调用未定义函数array_key_last()”   代码中的第三行

但是array_key_last()是PHP函数。

https://www.php.net/manual/en/function.array-key-last.php

这是我的网站链接:http://rocallisa.xyz/

if($key === array_key_last($photos))

我的服务器正在运行PHP 7.3,但这无济于事。

2 个答案:

答案 0 :(得分:0)

在线出版物中的PHP版本是什么?

在PHP文档中:

  

array_key_last(PHP 7> = 7.3.0)

https://www.php.net/manual/es/function.array-key-last.php

您的远程服务器的版本是否高于7.3?

替代方法: How to get last key in an array?

祝你好运。

答案 1 :(得分:0)

在php-7.3之前,可能是内联方式。

With ActiveDocument.Tables(1)
  .Rows(.Rows.Count).Delete
End With

请注意错误控制运算符(因为new Microsoft.AspNetCore.Http.CookieOptions() { Expires = DateTime.Now.AddHours(120), Path = "/", HttpOnly = true, Secure = this.Request.IsHttps, IsEssential = true } ,或使用中介变量。

tf.data.Dataset

⚠使用$a = (object)["some"=>5, "stuffs"=>3]; echo @end(array_keys( $a )); // "stuffs" end()可以显着提高性能和占用内存,请考虑升级到php7.4。