Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从类中的公共函数中检索值到foreach.
foreach
$class->function()正在传递一个数组,我想扫描每个值。
$class->function()
foreach($class->function() as $key => $index) { $class->function()[$key];
奇怪的是,这段代码localhost运行正常,但在我的服务器上在线给出了这个错误:
localhost
解析错误:语法错误,意外 '[',期待 ',' 或 ';'
将函数的结果分配给某个变量:
$result = $class->function(); foreach($result as $key => $index) { echo $result[$key]; }
但是$result[$key]等于$indexFYI;
$result[$key]
$index
这种直接来自函数调用的访问值从PHP 5.4.
PHP 5.4
I have an html page with many tables.
<html> <table> POINTER_TEXT some other stuff <table that i want START> </table that i want END> some other stuff
4 shell - Shell 脚本:在 shell 脚本中运行“exit”命令后执行命令
1 architecture - 功能软件需求规范和项目时间表
3 c++ - 将 _msize 与 new[] 一起使用是否安全?
2 javascript - JavaScript/DOM:无法从 DOMParser 附加 XML
1 php - 使用魔术方法有什么缺点?如何在子类中缩写它们?
2 css - 我无法使用 CSS 使导航居中
1 apache - 如何配置同时对 apache 可写的主目录
4 perl - “Perl 编程”中的“直接评估布尔结果,并且不发生智能匹配”是什么意思?
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641