
[php] strip_tags HTML 태그를 제거하기
2022. 11. 24. 10:27
웹프로그래밍/PHP
php strip_tags 함수를 통해 문자열의 HTML 태그를 제거할 수 있다. 더보기 참고 : https://www.php.net/manual/en/function.strip-tags.php PHP: strip_tags - Manual With most web based user input of more than a line of text, it seems I get 90% 'paste from Word'. I've developed this fn over time to try to strip all of this cruft out. A few things I do here are application specific, but if it helps you - great, if you c www.php..

[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 함수를 통해 변수가 배열이 맞는지 아닌지 여부를 검색할 수 있다.

[php] strtolower / strtoupper 소문자 대문자 변경하기
2022. 11. 21. 15:00
웹프로그래밍/PHP
php strtolower 함수를 통해 문자열 전부를 알파벳 소문자로 변경이 가능하다. 결과 : a테b스c트d입e니fg다. 더보기 참고 : https://www.php.net/manual/en/function.strtolower.php

[php] header Location 사용하여 페이지 이동하기
2022. 10. 24. 16:31
웹프로그래밍/PHP
php header 함수를 통해 페이지 이동, 즉 리다이렉트(redirect) 처리가 가능하다. header() 함수위에 공백이 존재하면 에러가 발생하니 주의하자. 더보기 참고 : https://www.php.net/manual/en/function.header.php PHP: header - Manual After lots of research and testing, I'd like to share my findings about my problems with Internet Explorer and file downloads. Take a look at this code, which replicates the normal download of a Javascript: Now let me explain:..