Created
January 25, 2017 20:41
-
-
Save halgatewood/20857fbac38d82351dea8c44ed92c197 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function implode_piped_string( $array ) | |
| { | |
| if( !$array ) { return ""; } | |
| if( !is_array($array) ) { return ""; } | |
| return "|" . implode("|", array_filter(array_unique($array))) . "|"; | |
| } | |
| function explode_piped_string( $str ) | |
| { | |
| return array_filter(array_unique(explode("|", $str))); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment