Implode the Keys in the array
Implode the keys in an array instead of the values.
1. function implodeKey ( $glue , $array ) {
2. if ( !empty ( $array ) ) {
3. $str = '';
4. $i = 0;
5. foreach ( $array as $key => $arr ) {
6. if ( $i == 0 ) {}
7. else {
8. $str .= $glue;
9. }
10. $str .= $key;
11. $i++;
12. }
13. } else {
14. return false;
15. }
16. return $str;
17. }
Comments