Skip to content

Instantly share code, notes, and snippets.

@enlacee
Last active August 29, 2015 14:17
Show Gist options
  • Save enlacee/664380acf605f4b5a6cc to your computer and use it in GitHub Desktop.
Save enlacee/664380acf605f4b5a6cc to your computer and use it in GitHub Desktop.
urldecode, explode, strpos, substr
<?php
$urlImage = urldecode($urlImage);
$arrayImage = explode(_url_, $urlImage);
$pathImage = $arrayImage[1];
if (strpos($pathImage, '/',0) >= 0 ) {
$pathImage = substr($pathImage, 1,(strlen($pathImage)));
}
// file
$ext = pathinfo($meImage, PATHINFO_EXTENSION);
$baseName = basename($meImage, '.'.$ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment