"함수 is string()"의 두 판 사이의 차이

31번째 줄: 31번째 줄:


==같이 보기==
==같이 보기==
*[[gettype]]
*[[is_float]]
*[[is_int]]
*[[is_number]]
*[[is_number]]
*[[is_bool]]
*[[is_object]]
*[[is_array]]
*[[is_array]]
*[[gettype]]

2014년 9월 5일 (금) 06:33 판

is_string

1 PHP

// http://php.net/manual/en/function.is-string.php

$values = array('abc', '', ' ', '23', '23.5', '0', 23, 23.5, 0, true, false, NULL);
foreach ($values as $value) {
	echo 'is_string( ';
	var_export($value);
	echo ' ) = ';
	echo var_dump(is_string($value));
}
/*
is_string( 'abc' ) = bool(true)
is_string( '' ) = bool(true)
is_string( ' ' ) = bool(true)
is_string( '23' ) = bool(true)
is_string( '23.5' ) = bool(true)
is_string( '0' ) = bool(true)
is_string( 23 ) = bool(false)
is_string( 23.5 ) = bool(false)
is_string( 0 ) = bool(false)
is_string( true ) = bool(false)
is_string( false ) = bool(false)
is_string( NULL ) = bool(false)
*/

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}