Php取扩展名

Php取扩展名

/**

* 取扩展名

*/

 

function getext($url){

    $base = parse_url($url);

    $name = basename($base['path']);

    $ext = explode('.',$name);

    var_dump($ext[count($ext)-1]);

}

 

$url = 'https://www.baidu.com/game/tkdz.php?id=1.5';

getext($url);

posted @ 2017-04-20 10:33  刘俊涛的博客  阅读(188)  评论(0)    收藏  举报