-
[PHP] explode() 지정 문자 기준으로 문자열 나누기PHP 2022. 7. 9. 10:43반응형
[PHP] explode() 지정 문자 기준으로 문자열 나누기
explode() 함수는 지정 문자 기준으로 문자열 나누어 그 값을 배열로 반환 한다.
$str = 'www.naver.com'; $result = explode('.', $str); var_dump($result); /* 결과값 ['www', 'naver', 'com'] */
반응형'PHP' 카테고리의 다른 글
[PHP] str_replace() 문자열 바꾸기 (0) 2022.07.10 [PHP] substr() 문자열 자르기 (0) 2022.07.07 [PHP] nl2br() 줄바꿈 (0) 2022.07.06 [PHP] php 비슷하지만 다른 isset() / empty() null check (0) 2022.07.05 [PHP] array_push() 배열에 값을 추가 (0) 2022.07.04