Interviewer And Interviewee Guide

PHP Interview Question:

How to extract a file extension in php?

Submitted by: Muhammad
Old method was
$path_info = pathinfo('/images/myPicture.gif');
echo $path_info['extension']; //will print gif

New way is
$filename = '/images/myPicture.gif';
$ext = pathinfo($filename, PATHINFO_EXTENSION);
echo $ext;//will print gif
Submitted by: Muhammad

Read Online PHP Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.