jameshfisher
jameshfisher

Reputation: 36519

PHP: where is the mime_content_type function?

The documentation for mime_content_type says

This function has been deprecated as the PECL extension Fileinfo provides the same functionality (and more) in a much cleaner way.

That link is to the Fileinfo extension. That page itself links to its mime_content_type implementation. However, this page is one and the same page that says that it is deprecated in favour of the Fileinfo implementation. So there is an infinite recursive loop in the documentation.

So, what is it that has been deprecated, and where is the implementation which it has been deprecated in favour of?

Upvotes: 1

Views: 898

Answers (2)

Matthijs Wessels
Matthijs Wessels

Reputation: 6729

mime_content_type is not deprecated. It was apparently just a mistake in the documentation.

See this bug report

Upvotes: 2

Fabian
Fabian

Reputation: 394

The new function to determine file types is finfo_file, which will return the file's mime type as a string (like mime_content_type).

mime_content_type has been deprecated because the finfo_* functions are also accessible via a more modern, object oriented class.

Upvotes: -1

Related Questions