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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:28:43+00:00 2026-05-23T20:28:43+00:00

I have an array in PHP which looks like this: Array ( [2] =>

  • 0

I have an array in PHP which looks like this:

Array
(
    [2] => post4.post
    [3] => post7.post
    [4] => post5.post
    [5] => post3.post
    [6] => post6.post
    [7] => post1.post
    [8] => post2.post
)

How could I arrange it so it could look like this?

Array
(
    [0] => post7.post
    [1] => post6.post
    [2] => post5.post
    [3] => post4.post
    [4] => post3.post
    [5] => post2.post
    [6] => post1.post
)

The array has a list of the files contained in a folder. In my local server looks like the second example but on a standard server looks like the first one.

Thanks in advance 😀

  • 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-23T20:28:43+00:00Added an answer on May 23, 2026 at 8:28 pm

    rsort($array) will sort an array in reverse/descending order (from high to low).

    For future reference use this page (http://php.net/manual/en/array.sorting.php) to identify the most suited array sorting method for your needs.

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

Sidebar

Related Questions

I have a simple PHP Array called $categories that looks like this: Array (
I have a json array in my Particles controller that looks like this after
I have an array that I pull that looks like this: [157966745,275000353,43192565,305328212] ... How
All, I have some PHP PDO code that looks like this: <?php ... $query=$dbh->prepare(SELECT
I have an array in PHP which holds a bunch of unix timestamps. As
I have an an ajax request that looks like this, $('input.fakecheck').click(function(){ alert(deleteing....); $.ajax({ url:/search,
I have followed this tutorial which uses jQuery UI to generate Facebook tokens like:
I've got a form which looks like that: <form method=post enctype=multipart/form-data onsubmit=return new_post_form_submit();> <input
Say I have an array of strings in a php array called $foo with
A PHP array can have arrays for its elements. And those arrays can have

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.