Created
April 3, 2019 18:00
-
-
Save littlefuntik/0c9edbd6b4150f0d7295293129507198 to your computer and use it in GitHub Desktop.
Add filename prefix. "/a/b/c/abc.jpg" to "/a/b/c/abc-thumb.jpg"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = '/a/b/c/abc.jpg'; | |
$path_new = substr( $path, 0, strrpos( $path, '.' ) ) . '-thumb' . substr( $path, strrpos( $path, '.' ) ); | |
var_export( $path_new ); | |
// Output: /a/b/c/abc-thumb.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment