
[php] explode 문자열을 분할하여 배열로 저장하기
2022. 11. 22. 14:40
웹프로그래밍/PHP
php explode 함수를 통해 문자열을 분할하여 배열로 저장할 수 있다. $string 문자열의 " / " 기준으로 구분하여 분할된 값을 $explode 변수에 순서대로 담습니다. 결과 : echo $explode[0]; // 한국 echo $explode[1]; // 중국 echo $explode[2]; // 일본 echo $explode[3]; // 미국 더보기 참고 : https://www.php.net/manual/en/function.explode.php PHP: explode - Manual $tk) {$variable>0;$variable++;echo '$variable_'.$variable.' is ' .$tk.' ';}echo min(3,6);?> www.php.net

[php] implode 배열 요소를 문자열로 결합하기
2022. 11. 21. 22:01
웹프로그래밍/PHP
php 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..

[php] in_array 배열에 값이 존재하는지 확인하기
2022. 11. 21. 21:47
웹프로그래밍/PHP
php in_array 함수를 통해 배열에 값이 존재하는지 확인할 수 있다. 더보기 참고 : https://www.php.net/manual/en/function.in-array.php PHP: in_array - Manual Loose checking returns some crazy, counter-intuitive results when used with certain arrays. It is completely correct behaviour, due to PHP's leniency on variable types, but in "real-life" is almost useless.The solution is to use the strict checking option. www.php.net

[php] is_array 변수가 배열인지 여부 검색하기
2022. 11. 21. 21:29
웹프로그래밍/PHP
php is_array 함수를 통해 변수가 배열이 맞는지 아닌지 여부를 검색할 수 있다.