Category: Laravel, PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · June 11, 2020 · ⋆ Laravel It’s helpful sometimes when you have a file and it doesn’t have extension attached to it but you want to know the extension of the file regardless. For instance, If I’ve png file named foo.png and if I want to get the extension of this file, Laravel has got extension method on File facade which can be used to get the extension when the file has got the extension attached like so. But, as I mentioned earlier, if the file has no extension, say the png file with name foo only, how would you get the extension for the same? Well, according to this PR, there will be a guessedExtension method on the File facade, which will try to “guess” the extension of the file like so.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners