I have a PHP array like this:
array('A','B','C','F','a','b','c','d','e','f','h','i','j','k','l','o','q','!','?','0','2','3','4','9')
How can I convert this to:
array('A-C','F','a-f','h-l','o','q','!','?','0-4','9')
There will only be standard ASCII characters - nothing fancy. Every character can only appear once.
source https://stackoverflow.com/questions/72588940/compress-php-array-of-characters-to-shorter-array-with-a-z-a-z-0-9
No comments:
Post a Comment