Tag Info

New answers tagged


I don't know why that code didn't work for you. I copy that code and it work exactly as I expected. You should double check your case, did you unset $args variable before, or you can use another name ($agrs2 for example). Another problem in you question is: if pad_counts doesn't work, you will get 1 not 3.


You can use usort to sort the object $children. The function to sort after you got the $children object can be like this: usort( $children, function($a, $b) { $ai = filter_var($a->name, FILTER_SANITIZE_NUMBER_INT); $bi = filter_var($b->name, FILTER_SANITIZE_NUMBER_INT); if ($ai == $bi) { return 0; } return ($ai < $bi) ? ...

Top 50 recent answers are included