Jump to content

Alphabetizing a word


Mido

Recommended Posts

How can I sort a string alphabetically? I thought about creating an array ('a'=>0, 'b'=>1) etc, but didn't manage to work. So how can I do this? is there a predefined function for this? or I should create the algorithm? Thanks,

 

Example:

$word = 'cbad432'; // should become: '234abcd'

Link to comment
https://forums.phpfreaks.com/topic/209565-alphabetizing-a-word/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.