Skip to content

Instantly share code, notes, and snippets.

@bepatrickdavid
Created April 10, 2018 17:36
Show Gist options
  • Save bepatrickdavid/ce9dfc0e6e085421f617f68b56304259 to your computer and use it in GitHub Desktop.
Save bepatrickdavid/ce9dfc0e6e085421f617f68b56304259 to your computer and use it in GitHub Desktop.

Revisions

  1. bepatrickdavid created this gist Apr 10, 2018.
    28 changes: 28 additions & 0 deletions es3.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@

    //$d è un oggetto stdClass
    //$newd = new stdClass;
    //$newd->ID = "MAIN";
    //$newd->NAME = "Look - The Concept Factory";
    //$newd->ADDRESS = "Zona industriale Villanova, 19 32013 Longarone (BL) ITALY";
    //$newd->TEL = "+390437573060";
    //$newd->MAIL = "[email protected]";
    //$newd->WEBSITE = "www.lookocchiali.it";
    //$newd->DISTANCE = "";
    //$newd->DURATION = "";
    //$newd->NUMBER = "";
    //$newd->MAPS = "https://www.google.it/maps/place/Look+the+Concept+Factory/";

    // ordino per il campo number

    array_push($allDistance,$d);

    //var_dump($allDistance);

    usort ($allDistance, function ($a, $b){
    if ($a->NUMBER == $b->NUMBER) {
    return 0;
    }
    return ($a->NUMBER < $b->NUMBER) ? -1 : 1;
    });

    //var_dump($allDistance);