I would make it an array and use the sort function:
$string = 'bac';
$stringParts = str_split($string);
sort($stringParts);
echo implode($stringParts); // abc
More Related Contents:
- Delete first 3 characters and last 3 characters from String PHP
- Remove first 4 characters of a string with PHP
- How can I combine two strings together in PHP?
- PHP Sort Array By SubArray Value
- How to generate all permutations of a string in PHP?
- PHP convert string to hex and hex to string
- Converting an integer to a string in PHP
- How to sort date array in php?
- PHP unserialize fails with non-encoded characters?
- Is a new line = \n OR \r\n?
- Title case a string containing one or more last names while handling names with apostrophes
- Sort multi-dimensional array by specific key
- Php – regular expression to check if the string has chinese chars
- how to re-format datetime string in php?
- How can I split a string in PHP at the nth occurrence of a needle?
- How to sort an array of arrays in php?
- Getting the first character of a string with $str[0]
- PHP: Split multibyte string (word) into separate characters
- What does the b in front of string literals do?
- Search and replace multiple values with multiple/different values in PHP5?
- Explode string into array with no empty elements?
- Reverse the letters in each word of a string
- How to separate letters and digits from a string in php
- How does PHP compare strings with comparison operators?
- how to sort a multidemensional array by an inner key
- How do I get the byte values of a string in PHP?
- How to validate that a string only contain lowercase letters?
- Sort a multidimensional array descending by subarray count and preserve first level keys
- Regex to match an IP address [closed]
- How do I detect non-ASCII characters in a string?