
728x90
반응형
php implode 함수를 통해 배열 문자열을 하나의 문자열로 결합할 수 있다.
<?php
$array = array("한국","중국","일본","미국");
$implode = implode("/", $array);
echo $implode;
?>
결과 : 한국/중국/일본/미국
더보기
참고 :
https://www.php.net/manual/en/function.implode.php
PHP: implode - Manual
Sometimes it's necessary to add a string not just between the items, but before or after too, and proper handling of zero items is also needed.In this case, simply prepending/appending the separator next to implode() is not enough, so I made this little he
www.php.net
728x90
반응형
'웹프로그래밍 > PHP' 카테고리의 다른 글
[php] strip_tags HTML 태그를 제거하기 (0) | 2022.11.24 |
---|---|
[php] explode 문자열을 분할하여 배열로 저장하기 (0) | 2022.11.22 |
[php] in_array 배열에 값이 존재하는지 확인하기 (0) | 2022.11.21 |
[php] is_array 변수가 배열인지 여부 검색하기 (0) | 2022.11.21 |
[php] strtolower / strtoupper 소문자 대문자 변경하기 (0) | 2022.11.21 |