공부
[PHP] join -> implode; split -> explode
승가비
2021. 1. 14. 06:56
728x90
implode ( string $separator , array $array ) : string
explode ( string $separator , string $string , int $limit = PHP_INT_MAX ) : array
https://www.php.net/manual/en/function.implode.php
PHP: implode - Manual
It's not obvious from the samples, if/how associative arrays are handled. The "implode" function acts on the array "values", disregarding any keys: 'four', 'five', '3rd' => 'six' );echo implode( ',', $a ),'/', implode( ',', $b );?>outputs:one,two,three/fou
www.php.net
https://www.php.net/manual/en/function.explode.php
PHP: explode - Manual
function aexplode($delimiters,$string,$trimduplicate = false) { if (!is_array($delimiters)) return explode($delimiters,$string); $stringaux = str_replace($delimiters, $delimiters[0], $string); if ($trimduplicate) while
www.php.net
728x90