Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:27:20+00:00 2026-05-24T06:27:20+00:00

I am trying to get the specific value of file extension in this array.

  • 0

I am trying to get the specific value of file extension in this array. All I can do so far is .

I am wanting the fileextention “.jpg”

All I know how to do is echo the values like so using foreach;

file_nameBob7213.jpg file_typeimage/jpeg
file_pathC:/xampp/htdocs/midas/records/
full_pathC:/xampp/htdocs/midas/records/Bob7213.jpg raw_nameBob7213
orig_nameBob72.jpg client_nameafasfafs.jpg **file_ext.jpg** file_size44.96
is_image1 image_width716 image_height474 image_typejpeg
image_size_strwidth="716" height="474"

I am only interested in retrieving the file_ext from this array. How do I select that exact thing?

foreach ($file['upload_data'] as $item => $value)
{
  echo $item; echo $value; echo "<br/>";
}

How do I do this? , thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:27:21+00:00Added an answer on May 24, 2026 at 6:27 am
    $file['upload_data']['file_ext']
    

    It’s just an array within an array, so specify 2 array keys

    Incidentally, if you want to see the contents of an array, a quick way of doing it is to use var_export:

    var_export($file); # echoes the entire array
    

    You don’t need to write a foreach loop every time

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a csv file and am trying to get one specific value on,
I'm trying to get the source attribute of all images withing a specific div
I'm trying to calculate the SHA-1 value of a file. I've fabricated this script:
I am trying to get the number of specific nodes in an XML file
I'm trying to get a specific asp:button onclick event to fire when I press
Im trying to get some checkbox with a specific name document.getElementsByName(test); Unfortunatley i cant
I am trying to get a list of shares on a specific machine. So
I'm trying to get a custom handler to work for a specific URL (or
I'm trying to get the .Left property of a specific tab page in a
I am trying to get a list of elements with a specific xsd type

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.