Jump to content

Search the Community

Showing results for tags 'filename sort numeric'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi I want to show all images in a folder. My images are named 1.svg, 2.svg, 3.svg, 4.svg, 5.svg, 6.svg, 7.svg, 8.svg, 9.svg, 10.svg, 11.svg, 12.svg, 13.svg, 14.svg, 15.svg, 16.svg, 17.svg, 18.svg, 19.svg, 20.svg. When I sort with natural sort function or any sort function I can find it does not do it correctly. it goes 1, 10, 100... I need it be normal order of filenames.. here is the page and how it loading the results now: http://www.wallartstickersuk.com/imageviewer.php Martin $files = glob("img/products/database small image/*.*"); sort($files,SORT_NUMERIC); for ($i=0; $i<count($files); $i++) { $num = $files[$i]; print $num."<br />"; echo '<img src="'.$num.'" width="250" alt="random image" />'."<br /><br />"; } Thanks Martin
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.