note 109740 deleted from function.strrchr by cmb
| From: | cmb@php.net | Date: | Sun, 16 Jan 2022 13:49:54 +0000 |
| Subject: | note 109740 deleted from function.strrchr by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217500@lists.php.net to get a copy of this message | ||
Note Submitter: jphansen at uga dot edu
----
To extract your portion of a string without the actual character you searched for, you can use:
<?php
$path = '/www/public_html/index.html';
$filename = substr(strrchr($path, "/"), 1);
echo $filename; // "index.html"
?>