Wednesday, March 28, 2012

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);






No comments:

Post a Comment

If you Satisfied , Please Leave a comment