Number-string 형 변환

Jmnote (토론 | 기여)님의 2016년 5월 6일 (금) 16:17 판
number to string
str

1 PHP

$num = 42;
$str = "$num";
var_dump($num);
var_dump($str);
# int(42)
# string(2) "42"

2 Python

num = 42
mystr = str(num)
print( type(num) )
print( type(mystr) )
# <type 'int'>
# <type 'str'>

3 같이 보기

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