PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

debug_zval_dump> <urlencode
Last updated: Sun, 25 Nov 2007

view this page in

변수 관련 함수

소개

변수가 가지는 성질에 대한 정보는, 매뉴얼 언어 레퍼런스 섹션의 변수 엔트리를 참고하십시오.

요구 조건

이 확장을 빌드할 때 외부 라이브러리가 필요하지 않습니다.

설치

이 함수들은 설치하지 않아도 사용할 수 있습니다; PHP 코어의 일부입니다.

실행시 설정

이 함수의 작동은 php.ini 설정에 영향을 받습니다.

변수 설정 옵션
이름 기본값 변경가능성
unserialize_callback_func "" PHP_INI_ALL
PHP_INI_* 상수에 관한 자세한 내용과 정의는 ini_set()을 참고하십시오.

위 설정 지시어에 대한 간단한 설명입니다.

unserialize_callback_func string

unserializer가 작성할 필요가 있는 미정의 클래스를 발견하면, (미정의 클래스 이름을 인자로) unserialize 콜백 함수를 호출합니다. 지정한 함수가 정의되어 있지 않거나, 함수가 존재하지 않는 클래스를 포함/상속하지 못하면 경고를 발생합니다. 콜백 함수가 필요한 경우에만, 이 엔트리를 지정하십시오.

참고: unserialize().

자원형

이 확장은 리소스형을 정의하지 않습니다.

예약 상수

이 확장은 상수를 정의하지 않습니다.

Table of Contents

  • debug_zval_dump — Dumps a string representation of an internal zend value to output
  • doubleval — floatval의 별칭
  • empty — 변수가 비어있는지 검사합니다.
  • floatval — 변수의 실수값을 얻습니다.
  • get_defined_vars — 모든 정의된 변수의 배열을 반환합니다.
  • get_resource_type — 자원형을 반환합니다.
  • gettype — 변수 형을 얻습니다.
  • import_request_variables — GET/POST/쿠키 변수를 전역으로 가져옵니다.
  • intval — 변수의 정수값을 얻습니다.
  • is_array — 변수가 배열인지 확인합니다.
  • is_binary — Finds whether a variable is a native binary string
  • is_bool — 변수가 불린인지 확인합니다.
  • is_buffer — Finds whether a variable is a native unicode or binary string
  • is_callable — 변수의 내용이 함수처럼 호출할 수 있는지 확인합니다.
  • is_double — is_float의 별칭.
  • is_float — 변수가 실수인지 확인합니다.
  • is_int — 변수가 정수인지 확인합니다.
  • is_integer — is_int의 별칭.
  • is_long — is_int의 별칭.
  • is_null — 변수가 NULL인지 확인합니다.
  • is_numeric — 변수가 수나 수 문자열인지 확인합니다.
  • is_object — 변수가 객체인지 확인합니다.
  • is_real — is_float의 별칭.
  • is_resource — 변수가 자원인지 확인합니다.
  • is_scalar — 변수가 스칼라인지 확인합니다.
  • is_string — 변수가 문자열인지 확인합니다.
  • is_unicode — Finds whether a variable is a unicode string
  • isset — 존재하는 변수인지 확인합니다.
  • print_r — 변수에 관한 정보를 사람이 읽기 좋게 출력합니다.
  • serialize — 값의 저장 표현을 생성합니다.
  • settype — 변수형을 설정합니다.
  • strval — 변수의 문자열값을 얻습니다.
  • unserialize — 저장 표현에서 PHP 값을 작성합니다.
  • unset — 주어진 변수를 제거합니다.
  • var_dump — 변수에 관한 정보를 덤프합니다.
  • var_export — 변수의 표현을 출력하거나 문자열로 반환합니다.


add a note add a note User Contributed Notes
변수
jfrasca at sheerdev dot com
31-Aug-2005 10:27
I needed a simple function that would reduce any kind of variable to a string or number while retaining some semblance of the data that was stored in the variable. This is what I came up with:

<?
function ReduceVar ($Value) {
    switch (gettype($Value)) {
        case "boolean":
        case "integer":
        case "double":
        case "string":
        case "NULL":
            return $Value;
        case "resource":
            return get_resource_type($Value);
        case "object":
            return ReduceVar(get_object_vars($Value));
        case "array":
            if (count($Value) <= 0)
                return NULL;
            else
                return ReduceVar(reset($Value));
        default:
            return NULL;
    }
}
?>
skelley at diff dot nl
22-Sep-2001 04:55
Sorry to say Mykolas, but your definition would not be correct.

isempty() evaluates to true for NULL, 0, "", false or 'not set' for any variable, object etc. that can be set to a value.

isset() evaluates to true if the variable, object etc. exists at all, whether it is 'empty' or not.

Example:
$foo = 0;
isset($foo); //will evaluate to true.
!empty($foo); //will evaluate to false.

unset($foo);
isset($foo); //will evaluate to false.
!empty($foo); //will evaluate to false.

debug_zval_dump> <urlencode
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites