我有以下数组:
["theme","1,strand","Medical Ethics and Law,strandyear","Year 3"]如何提取数组中的第二个最后值,然后在逗号后面提取该值的第二部分。“医学伦理与法律,绞刑年”?
例如,这应该会导致“strand放年”。
对于其他数组,实际值(而不是末尾的位置)将有所不同。
PHP 5.3.3..。
发布于 2019-06-17 06:19:28
获取数组中的第二个最后值的最佳方法
end($array);
$second_last = prev($array);之后,您无法得到第二部分,即您可以使用的逗号后面的值。
explode(separator,string) //function in PHP
$temp= explode(',', $second_last);//converted to an array
$second_part=$temp[1];https://stackoverflow.com/questions/56625552
复制相似问题