note 130111 added to function.explode

From: Date: Mon, 03 Mar 2025 20:09:14 +0000
Subject: note 130111 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-221939@lists.php.net to get a copy of this message
If you want to retrieve the last value after executing 'explode', follow these steps using 'array_pop': $path = 'path/to/file.txt'; echo $fileName = array_pop(explode('/', $path)); // file.txt ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.84.18 (proxied: 70.28.88.236) ---- Manual Page -- https://php.net/manual/en/function.explode.php Edit -- https://main.php.net/note/edit/130111 Del: integrated -- https://main.php.net/note/delete/130111/integrated Del: useless -- https://main.php.net/note/delete/130111/useless Del: bad code -- https://main.php.net/note/delete/130111/bad+code Del: spam -- https://main.php.net/note/delete/130111/spam Del: non-english -- https://main.php.net/note/delete/130111/non-english Del: in docs -- https://main.php.net/note/delete/130111/in+docs Del: other reasons-- https://main.php.net/note/delete/130111 Reject -- https://main.php.net/note/reject/130111 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221939) next »