- print_r: documentation ( source)
- natcasesort: documentation ( source)
<?php
class Foo
{
public $str;
public function __toString()
{
return $this->str;
}
}
$a = new Foo();$a->str = '111';
$b = new Foo();$b->str = '1b';
$c = new Foo();$c->str = '1A';
$list = [$a, $b, $c];
natcasesort($list);
print_r($list);