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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:20:41+00:00 2026-05-30T23:20:41+00:00

So we got the values (INT) : V1 , V2 , V3 , V4

  • 0

So we got the values (INT) :

V1 , V2 , V3 , V4

And the text :

Text1 , Text2 , Text3 , Text4

We will order the values and echo corespondent Text instead of values.

Let’s take an example :

(variables) :  V1 = 1 , V2 = 30 , V3 = 2 , V4 = 4
(text) :  Banana ,   Cake  ,  Apple , Patato

Will result ->

V1 , V3 , V4 , V2 

after they are ordered but we will display text instead of our current result .
So the final echo is :

Banana , Apple , Patato , Cake . (will echo them into a table)

Note : Some of the values can be equal !

So far i tried with 3 arrays :

($text_array) text , ($arr1) V1[...] , and ($arr2) V1[...] 

(same as second because I use sort($array); on it).

I tried to echo with :

echo $text_array[array_search($arr1[0], $arr2)]; 

but this will make the text repeat if values are the same.

I am sorry if I did not make myself clear … it’s really hard to explain.

#

    UPDATE

#

It looks like this :

$V1 = $vars[1] + $vars[29] + $vars[30];
$V2 = $vars[6] + $vars[19] + $vars[40];
$V3 = $vars[14] + $vars[15] + $vars[44];
$V4 = $vars[0] + $vars[22] + $vars[37];
..........................................
$V15 = $vars[3] + $vars[28] + $vars[31];

Text array :

$valori = array(("Altruismul", "Simtul estetic", "Creativitatea", "Stimularea intelectuala", "Reusita obiectivata", "Independenta", "Prestigiul", "Conducerea altora", "Avantajele materiale", "Siguranta", "Ambianta de la locul de munca", "Relatiile cu superiorii", "Relatiile cu colegii", "Stilul de viata pe care-l asigura profesia", "Varietate");

Tried :

$arr = array("Altruismul" => $V1 , "Simtul estetic" => $V2 , "Creativitatea" => $V3 , "Stimularea intelectuala" => $V4 , "Reusita obiectivata" => $V5 , "Independenta" => $V6 , "Prestigiul" => $V7 , "Conducerea altora" => $V8 , "Avantajele materiale" => $V9 , "Siguranta" => $V10 , "Ambianta de la locul de munca" => $V11 , "Relatiile cu superiorii" => $V12 , "Relatiile cu colegii" => $V13 , "Stilul de viata pe care-l asigura profesia" => $V14 , "Varietate" => $V15);
            asort($arr);    

Did not work well.

  • 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-30T23:20:42+00:00Added an answer on May 30, 2026 at 11:20 pm

    I’m guessing what you’re trying to say is that you have two arrays that are linked, and you want to sort one and use that sorting to output the second. If so, try this:

    $amount = array(1 => 1, 2 => 30, 3 => 2, 4 => 4);
    $food = array(1 => 'Banana', 2 => 'Cake', 3 => 'Apple', 4 => 'Patato');
    asort($amount);
    
    foreach($amount as $key => $val) {
        echo "{$food[$key]} - $val\n";
    }
    

    Or alternatively:

    $food = array('Banana' => 1, 'Cake' => 30, 'Apple' => 2, 'Patato' => 4);
    asort($food);
    
    foreach($food as $item => $val) {
        echo "$item - $val\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a quick question about default values in PL/SQL functions in Oracle. Take
I've got some blank values in my table, and I can't seem to catch
I've got three boolean values A, B and C. I need to write an
I have some difficulties in my project. I got the RGB values from a
I got a string array and values are as follows sNames[0] = Root |
If I've got an array of values that are basically zero-padded string representations of
I've got a whole host of values stored in a .net 2.0 hashtable. What
I've got a C# program with values in a config file. What I want
I have got a form that posts values to a page in a wizard.
I've got a CSV file containing latitude and longitude values, such as: 25°36'55.57E,45°39'12.52N Anyone

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.