I have a database with data that needs to be retrieved, sorted, and displayed to a webpage. The main column of interest, we'll call it paragraphNum with data that looks something like "A.3.2.1", "A.3.13.2", "A.10.1.4" etc. When I retrieve the data and display it sorted, it will put "A.3.13.2" ahead of "A.3.2.1", and "A.10.1.4" ahead of both of them. because it just goes character by character and takes '13' as a '1' followed by a '3' rather than the number '13'. Same thing for the items that start with numbers. (Windows has the option to "smart sort" file names, that's basically what I'm trying to do with the data)
I know it's a long shot, but is there any somewhat simple way to do this other than writing a function to step through each paragraphNum character-by-character, using periods to mark the end of a whole number, then sorting? I'm fairly new to php so I'm not very familiar with many advanced functions, so maybe I missed something that will aid me as there seem to be quite a few powerful string manipulation functions.
I am using MySQL, PHP, and Javascript.