【发布时间】:2013-10-24 20:31:22
【问题描述】:
例如:
echo explode('@',$var); //but only echoing element 1 or 2 of the array?
代替:
$variable = explode('@',$var);
echo $variable[0];
谢谢。
【问题讨论】:
-
投反对票的人能解释一下自己吗?
-
Explode 将字符串转换为数组。数组元素是字符串时如何访问它?
-
我确实尝试过解决问题,但无济于事。我有大约 6 个月的 PHP 经验,我读过的关于如何解决这个问题的内容没有任何突出之处。
-
@OBV:这是一个使用
list()的演示,它不使用临时变量或额外的函数调用 -- eval.in/54886
标签: php