Home › Forums › General Issues › how to get filetype (extension)? › Reply To: how to get filetype (extension)?
Hi there, what you’re trying to do could be achieved with a built-in PHP function.
Check out this article:
http://stackoverflow.com/questions/173868/how-to-extract-a-file-extension-in-php
You would declare a variable to use as the file extension. Something like:
$ext = pathinfo($url, PATHINFO_EXTENSION);
Reference: http://php.net/manual/en/function.pathinfo.php
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.