- is_string
1 PHP[ | ]
PHP
Copy
// 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 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.