Php obtains the file extension from a given url ,. Php obtains the file extension from a given url. this example describes how php obtains the file extension from a given url. Share it with you for your reference. The specific implementation method is as follows: p php obtains the file extension from the given url,
This example describes how php obtains the file extension from a given url. Share it with you for your reference. The specific implementation method is as follows:
<? Php/*** get the file suffix * @ param string $ url * @ return string */function getUrlPostfix ($ url) {$ url_arr = explode ('. ', $ url); $ postfix = $ url_arr [count ($ url_arr)-1]; $ substr = substr ($ postfix, 0, 3); return $ substr ;} $ url = "http://www.bkjia.com/index.html? Id = 1 "; $ str = getUrlPostfix ($ url); echo $ str." \ n ";
I hope this article will help you with php programming.
Example: php obtains the file extension from a given url. Share it with you for your reference. The specific implementation method is as follows: p...