답변 3개 / 댓글 2개
채택된 답변
+20 포인트
+ PHP Manual > Language Reference > Types > Strings… Variable parsing
- https://www.php.net/manual/en/language.types.string.php#language.types.string.parsing
아래처럼 변수명의 끝을 명시적으로 지정 가능합니다.
<?php
$juice = "apple";
echo "He drank some $juice juice.".PHP_EOL;
// Invalid. "s" is a valid character for a variable name, but the variable is $juice.
echo "He drank some juice made of $juices.";
// Valid. Explicitly specify the end of the variable name by enclosing it in braces:
echo "He drank some juice made of ${juice}s.";
그 아래쪽으로 Complex (curly) syntax 부분까지 쭉 이어서 보면 됩니다.
답변을 작성하려면 로그인이 필요합니다.