티스토리 뷰

공부

[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

'공부' 카테고리의 다른 글

[Python] datetime, timestamp  (0) 2021.01.14
[Java] URLEncode  (0) 2021.01.14
[PHP] str_replace("a", "b" "abc") -> "bbc"  (0) 2021.01.14
[Python] typeof -> `isinstance(s, str)`  (0) 2021.01.14
[Python] url to image  (0) 2021.01.14
댓글