Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

if i have a link and i want to know what is the extension of that link how can i do that?

for example i have this link
$link = http://www.sdfsad.com/sada.rar
i want to get "rar"
0
mgtm3
Asked:
mgtm3
1 Solution
 
RemcovCCommented:
This should do the trick

$extension = Substr($link, strrpos($link,".")+1)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now