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

  • SEARCH
  • Home
  • 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 9160735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:48:26+00:00 2026-06-17T13:48:26+00:00

Possible Duplicate: How to get file name from full path with PHP? echo ‘<td

  • 0

Possible Duplicate:
How to get file name from full path with PHP?

echo '<td width="11%" class="imagetd">'. ( ( empty ($arrImageFile[$key]) ) ? "&nbsp;" : htmlspecialchars( is_array( $arrImageFile[$key] ) ? implode(",", $arrImageFile[$key]) : $arrImageFile[$key] ) ). '</td>' . PHP_EOL;
echo '<td width="11%" class="videotd">'. ( ( empty ($arrVideoFile[$key]) ) ? "&nbsp;" : htmlspecialchars( is_array( $arrVideoFile[$key] ) ? implode(",", $arrVideoFile[$key]) : $arrVideoFile[$key] ) ). '</td>' . PHP_EOL;
echo '<td width="11%" class="audiotd">'. ( ( empty ($arrAudioFile[$key]) ) ? "&nbsp;" : htmlspecialchars( is_array( $arrAudioFile[$key] ) ? implode(",", $arrAudioFile[$key]) : $arrAudioFile[$key] ) ). '</td>' . PHP_EOL;

In the above code I have 2 table columns which depending if there are content or not display information in the table cells. Now as you can see the three columns are Image, Video and Audio. Now these columns display the relevant file names in their table cells. Below is how they are displayed:

  • All Image Files contain the string ImageFiles/ before the filename, e.g. ImageFiles/Lighthouse.png
  • All Video Files contain the string VideoFiles/ before the filename, e.g. VideoFiles/sample_mpeg.mp4
  • All Audio Files contain the string AudioFiles/ before the filename, e.g. AudioFiles/Music.mp3

As you can see each file contains the directory string before the filename. But what I want to do is that for each column and for each file, remove the relative directory string or in other words remove ImageFiles/, AudioFiles/ and VideoFiles/ from the whole string of each filename as I do not want the user to know the name of the directory. But how can this be done?

  • 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-06-17T13:48:27+00:00Added an answer on June 17, 2026 at 1:48 pm

    PHP has a function for it: basename

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

Sidebar

Related Questions

Possible Duplicate: Get file name from URI string in C# How to extract file
Possible Duplicate: get name of current PHP script in include file Can an included
Possible Duplicate: Get full path of a file with FileUpload Control I want to
Possible Duplicate: jQuery: get the file name selected from <input type=file /> I have
Possible Duplicate: Full path from file input using jQuery I have the following html
Possible Duplicate: How to get file name without the extension? I have a list
Possible Duplicate: bash tool to get nth line from a file I want to
Possible Duplicate: how to extract data from csv file in php An assignment I
Possible Duplicate: How do I extract a file/folder_name only from a path? May I
Possible Duplicate: How do I get the name of a file's owner in Java

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.