If options is smartdog services specified, returns all available elements. Notice: Undefined index: extension in test.
Here is a simple function that gets the extension of a file. If you want to easily assign the values returned by pathinfo to separate variable names, list isn’t enough. Note that this function seems to just perform string operations, and will work even on a non-existent path, e. This function will not split a file’s stem and extension for you. 0 or null is specified for the option argument.
So you’ll need to define it’s value manually if the option field is omitted, to provide the default functionality. For a good example of how platform independent this function is have a look at the different return values that Lostindream and I experienced. This code is to work in index. A warning: this function varies depending on the platform it is being run on.
A bit like the Locale settings, but unexpected. This function is not perfect, but you can use it to convert a relative path to a URL. Please email me if you can make any improvements. The idea is that you reverse the string and create a substring that starts after the first ‘. Sometimes, it’s interessant to get the basename without extension. Notice: Undefined index: extension in test.