php - Codeigniter get_filename ordering by name -
I found directory in codeigniter to publish a document, but can not order it
< P> Can I sort it by alphabet anyway? This is the code given below and I went through the documentation but could not find anything. $ this-> Load-> Assistant ('directory'); $ List_movs = get_filenames ('. / Spots'); Foreign exchange ($ list_move $ mov): $ movs [$ mov] = $ mov; Endforeach;
Thank you
$ list_movs
just a regular array
you just can sort it by using Sort ($ list_mov)
If you want to sort the natural order if case insensitive:
sort ($ List_movs, SORT_NATURAL | SORT_FLAG_CASE);
The natcasesort () note is similar to using
, the key values are not kept Association, but I do not think you can use
Comments
Post a Comment