what does moodle use to get the file extension of a file?

Re: what does moodle use to get the file extension of a file?

by Di Juwel -
Number of replies: 0

I'll be more specific, i'm in "/course/resources.php"
in a foreach function in line 116.

I see a lot of information about the resource in the $cm and $resource but what i'm trying to extract in the file extension in case the resource is a file.

what I can do is use $cm->icon as a reference , as it hints the file extension.
what I really need is the file path somehow - once I have that it's easy to use PHP's pathinfo function to get the file extension.