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.
AWK では、コンマで区切られた可変フィールド文字列を取得し、AWK の $NF 変数を使用して最後のフィールドを解析できます。
PHPでこれを行う方法はありますか?ありがとう!
$myLastElement = end(array_values($yourArray));
上記は動作します!
ワンライナーとして…
$NF = end(array_map('trim', explode(',', $commadelimitedstring)));