Miscellaneous Functions
Miscellaneous Functions
PHP 함수를 분류하다 보면 어느 카테고리에도 안 들어맞는 함수들이 생기기 마련이에요. 이 페이지는 그렇게 다른 분류에 맞지 않아 따로 모아 둔 함수들을 담고 있어요.
출처: Misc. Functions
본문
이 함수들은 다른 어떤 카테고리에도 맞는 것 같지 않아서 여기에 모아 둔 함수들이에요.
설치·설정(Installing/Configuring)
- 런타임 설정(Runtime Configuration)
- 사전 정의 상수(Predefined Constants)
Misc. 함수(Misc. Functions)
connection_aborted— 클라이언트가 연결을 끊었는지 확인해요.connection_status— 연결 상태 비트필드를 반환해요.constant— 상수의 값을 반환해요(Returns the value of a constant).define— 이름 있는 상수를 정의해요(Defines a named constant).defined— 주어진 이름의 상수가 존재하는지 확인해요(Checks whether a constant with the given name exists).die—exit의 별칭(Alias of exit).eval— 문자열을 PHP 코드로 평가해요(Evaluate a string as PHP code).exit— 상태 코드나 메시지와 함께 현재 스크립트를 종료해요(Terminate the current script with a status code or message).get_browser— 사용자 브라우저가 무엇을 지원하는지 알려줘요(Tells what the user's browser is capable of).__halt_compiler— 컴파일러 실행을 중단해요(Halts the compiler execution).highlight_file— 파일의 문법 강조(Syntax highlighting of a file).highlight_string— 문자열의 문법 강조(Syntax highlighting of a string).hrtime— 시스템의 고해상도 시간을 가져와요(Get the system's high resolution time).ignore_user_abort— 클라이언트 연결 해제가 스크립트 실행을 중단시킬지 설정해요(Set whether a client disconnect should abort script execution).pack— 데이터를 바이너리 문자열로 묶어요(Pack data into binary string).php_strip_whitespace— 주석과 공백을 제거한 소스를 반환해요(Return source with stripped comments and whitespace).sapi_windows_cp_conv— 문자열을 한 코드페이지에서 다른 코드페이지로 변환해요(Convert string from one codepage to another).sapi_windows_cp_get— 현재 코드페이지를 가져와요(Get current codepage).sapi_windows_cp_is_utf8— 코드페이지가 UTF-8 호환인지 나타내요(Indicates whether the codepage is UTF-8 compatible).sapi_windows_cp_set— 프로세스 코드페이지를 설정해요(Set process codepage).sapi_windows_generate_ctrl_event— 다른 프로세스에 CTRL 이벤트를 보내요(Send a CTRL event to another process).sapi_windows_set_ctrl_handler— CTRL 이벤트 핸들러를 설정하거나 제거해요(Set or remove a CTRL event handler).sapi_windows_vt100_support— Windows 콘솔의 출력 버퍼에 연결된 지정 스트림에 대해 VT100 지원을 얻거나 설정해요(Get or set VT100 support for the specified stream associated to an output buffer of a Windows console).show_source—highlight_file의 별칭(Alias of highlight_file).sleep— 실행을 지연해요(Delay execution).sys_getloadavg— 시스템 평균 부하를 가져와요(Gets system load average).time_nanosleep— 초와 나노초 단위로 지연해요(Delay for a number of seconds and nanoseconds).time_sleep_until— 지정 시간까지 스크립트를 잠재워요(Make the script sleep until the specified time).uniqid— 시간 기반 식별자를 생성해요(Generate a time-based identifier).unpack— 바이너리 문자열에서 데이터를 풀어요(Unpack data from binary string).usleep— 마이크로초 단위로 실행을 지연해요(Delay execution in microseconds).- 변경 기록(Changelog)
더 알아보기
eval과exit/die는 동작에 부작용이 큰 함수라, 원문 매뉴얼의 주의사항을 함께 확인하는 것이 좋아요.pack/unpack은 바이너리 데이터를 다룰 때 자주 쓰여요. 포맷 문자열 문법을 익혀 두면 유용해요.