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

잔글 (Jmnote 사용자가 Is string 문서를 함수 is string() 문서로 옮겼습니다)
잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
4번째 줄: 4번째 줄:
==PHP==
==PHP==
[[category: PHP]]
[[category: PHP]]
<source lang='PHP'>
<syntaxhighlight lang='PHP'>
// http://php.net/manual/en/function.is-string.php
// http://php.net/manual/en/function.is-string.php


28번째 줄: 28번째 줄:
is_string( NULL ) = bool(false)
is_string( NULL ) = bool(false)
*/
*/
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:36 기준 최신판

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 }}