get File Extention name in php and javascript

// php
 $ext = substr(strrchr($fileName, '.'), 1);


// javascript
var file = $('#txtfile').val();
ext = file.substr(file.lastIndexOf('.')+1);
alert(ext);






Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress