File: index.php

Recommend this page to a friend!
  Classes of Raphael Paez  >  PHP Order Array Trait  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example
Class: PHP Order Array Trait
Sort arrays of indexed strings with custom sorting
Author: By
Last change:
Date: 2 months ago
Size: 606 bytes
 

Contents

Class file image Download
<?php

require_once "OrderTrait.php";

$exampleSpl = SplFixedArray::fromArray([
    [
       
"id" => 'arogtrg879512gggfg',
       
"name" => '?aaaaaa',
    ],
    [
       
"id" => 'assdfdsfsddfg8456g',
       
"name" => 'Aaaaaaa',
    ],
    [
       
"id" => 'asdsadfasd68f7sd5f41',
       
"name" => '-A',
    ],
    [
       
"id" => 'asdsadfasd68f7sd5f41',
       
"name" => 'ffffFFff',
    ],
    [
       
"id" => 'argswefweftrg879512gggfg',
       
"name" => 'Ddddddd',
    ]
]);

$array = OrderTrait::orderArrayPerson($exampleSpl->toArray(), 'name');
var_dump($array);


For more information send a message to info at phpclasses dot org.