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 7891597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:39:33+00:00 2026-06-03T06:39:33+00:00

Hi i have one situation and i dont know what exactly i need to

  • 0

Hi i have one situation and i dont know what exactly i need to do.

This is a multiple file upload so im doing this

$files = $_POST["files-temp"];

this return ( iten1.jpg;iten2.jpg;iten3.jpg;) there is a semicolon on last iten

then i did

$array = preg_split('/;/',$files);

then i got

Array ( [0] => iten1.jpg [1] => iten2.jpg [2] => iten3.jpg [3] => )

So there is a iten 4 that not exists, so i need to find a better way to do this then count and execut the query to save on mysql.

thanks for any help.

  • 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-03T06:39:35+00:00Added an answer on June 3, 2026 at 6:39 am

    If $files contains a string and want to remove that last extra array location:

    Try:

    $files = 'iten1.jpg;iten2.jpg;iten3.jpg;';
    $result = explode(";", rtrim($files,';'));
    print_r( $result );
    

    Test Here

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

Sidebar

Related Questions

I have a one-to-many relationship between two classes for this situation. I have a
This is my situation. I have two activities: ONE and TWO. In TWO activity
So the situation is like this: I have several links, each with one hidden
Consider the following situation: We have two Localizable.string files, one in en.lproj and one
This is the situation. I have a list of URLs that I need to
I have one situation I don't know how to solve... I have a rails
Here is my situation: I have one table that contains a list of drugs
Here is the situation: You have one long-running calculation running in a background thread.
I have the following situation: There is one custom view inside of the first
I have a situation where different threads populate a queue (producers) and one consumer

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.