Answers for "get file extension"

PHP
16

javascript get file extension

var fileName = "myDocument.pdf";
var fileExtension = fileName.split('.').pop(); //"pdf"
Posted by: Guest on August-02-2019
11

php get file extension from filename

$ext = pathinfo($filename, PATHINFO_EXTENSION);
Posted by: Guest on October-26-2020
2

get image extension in php

//get image extension of uploaded file in php
$imagetype = $_FILES['image']['name'];
$ext = pathinfo($imagetype, PATHINFO_EXTENSION);// get file extension
Posted by: Guest on October-19-2020
0

javascript get file extension from string

// Use the lastIndexOf method to find the last period in the string, and get the part of the string after that:

var ext = fileName.substr(fileName.lastIndexOf('.') + 1);
Posted by: Guest on October-16-2020

Browse Popular Code Answers by Language