"가변변수"의 두 판 사이의 차이

(새 문서: ==개요== ;variable variables ;가변변수 ==예시: PHP== <source lang='php'> <?php $hello = 'world'; $a = 'hello'; echo $$a; </source> ==같이 보기== *변수 ==참고...)
 
잔글 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
 
(다른 사용자 한 명의 중간 판 7개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;variable variables
;variable variables
;가변변수
;가변변수
*변수의 값을 다시 변수명으로 사용하는 것


==예시: PHP==
==예시: PHP==
9번째 줄: 10번째 줄:
$a = 'hello';
$a = 'hello';


echo $$a;
echo $$a; // world
</source>
</source>
:→ <code>$$a</code>는 <code>$hello</code>와 같은 의미가 됨


==같이 보기==
==같이 보기==
*[[Less 가변변수]]
*[[연관배열]]
*[[변수]]
*[[변수]]


==참고 자료==
==참고==
*http://php.net/manual/en/language.variables.variable.php
*http://php.net/manual/en/language.variables.variable.php
*https://css-tricks.com/snippets/php/variable-variables/


[[분류: 변수]]
[[분류: 변수]]

2017년 6월 27일 (화) 15:44 기준 최신판

1 개요[ | ]

variable variables
가변변수
  • 변수의 값을 다시 변수명으로 사용하는 것

2 예시: PHP[ | ]

<?php
$hello = 'world';
$a = 'hello';

echo $$a; // world
$$a$hello와 같은 의미가 됨

3 같이 보기[ | ]

4 참고[ | ]

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