Find Jobs
Hire Freelancers

Custom PHP array sorting function for dynamicaly built array

$10-30 USD

V teku
Objavljeno pred približno 5 leti

$10-30 USD

Plačilo ob dostavi
Need help with a custom PHP 5.6 array sorting function. We have a Multidimensional PHP array that looks like below, but the answer sets always change as the array is dynamically built. We would like to sort all items on the "Percent" column but also have any "Label" items that have a "None of these" or "Other" always sort to the bottom. The array column answer sets are dynamic and change so we do not know the label position ahead of time. We do not want to alter the structure of the current array so the label text is the only way to identify it. The array is dynamically built and may have more columns based on the situation but the first three columns will always be the same. cars = array( array(Label1, Count1, Percent1) array(Label2, Count2, Percent2) etc. ) OR with real data $cars = array ( array("Volvo",22,62), array("BMW",29,75), array("Saab",5,2), array("Land Rover",43,86) array("Other",31,78) array("None of these",8,15) ); Desired sort result Land Rover,43,86 BMW,29,75 Volvo,22,62 Saab,5,2 Other,31,78 None of these,8,15 Current function looks like this but does not sort the labels to the bottom function compareCount ($x, $y) { if ($x[2] == $y[2]) return 0; else if ($x[2] > $y[2]) return -1; else return 1; }
ID projekta: 18797629

Več o projektu

3 ponudb
Projekt na daljavo
Aktivno pred 5 leti

Želite zaslužiti?

Prednosti oddajanja ponudb na Freelancerju

Nastavite svoj proračun in časovni okvir
Prejmite plačilo za svoje delo
Povzetek predloga
Registracija in oddajanje ponudb sta brezplačna
3 freelancerjev je oddalo ponudbo s povprečno vrednostjo $27 USD za to delo
Avatar uporabnika
Hello I have 5 year experience in php development and i'm sure i can help you with this. i can start work right now. Please consider me for this job. Thanks
$20 USD v 1 dnevu
5,0 (199 ocen)
6,9
6,9
Avatar uporabnika
Dear sir, I am very interested in this project. I have 8+ Year of Experience in this field and I can surely do this project, I work as freelancer with my inhouse team. Please try to give me one chance to prove my strength and quality of work. I always believe in quality work and always ready to provide you best solution for your project. Trust me sir i never disappoint you at least you can give me one chance. Please check my profile in freelancer.com https://www.freelancer.com/u/mdubey.html Please message me on PM for further discussion. Thanks & Regards Mohit
$40 USD v 1 dnevu
4,3 (66 ocen)
6,1
6,1
Avatar uporabnika
Hi i have two year experience in web and app development field. i am new to freelancer but not in technology So please give me a chance to work with your project Thanks.
$20 USD v 1 dnevu
5,0 (6 ocen)
2,6
2,6

O stranki

Zastava UNITED STATES
Sacramento, United States
5,0
2
Plačilna metoda je verificirana
Član(ica) od nov. 28, 2017

Verifikacija stranke

Hvala! Po e-pošti smo vam poslali povezavo za prevzem brezplačnega dobropisa.
Pri pošiljanju vašega e-sporočila je šlo nekaj narobe. Poskusite znova.
Registrirani uporabniki Skupaj objavljenih del
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Nalaganje predogleda
Geolociranje je bilo dovoljeno.
Vaša prijavna seja je potekla, zato ste bili odjavljeni. Prosimo, da se znova prijavite.