변수와 텍스트를 문자열 php 로 결합하는 방법

코드 예제

7
0

php concat

$a = "hello";
$b = "world";
$c = $a . " " . $b;

echo $c; // hello world
2
0

변수와 텍스트를 문자열 php 로 결합하는 방법

<?php
$number = 8;
$txt = "the number is".$number.", ok?"; //Use a dot to combine
echo $txt;
?>
2
0

php 에서 두 문자열을 추가하는 방법

Remember dot .
1
0

변수 php 에 더 많은 데이터 추가

$a = "Hello ";
$a .= "World!";   
0
0

php 는 변수를 함수에 연결합니다

public function getAvg(string $var) {
  # A sample from a game I wrote.
  # Concatenatin on the other side is just {stuff.$var}
  # You can also concatenate multiple variables in a varaible:
  # {$varA.$varb}
  $min = $this->{$var._min};
  # Assigns to $min object property matching $var + '_min' string.
  $max = $this->{$var._max};
  # Assigns to $max object property matching $var + '_max' string.
  $avg = (($min + $max) / 2);
  return round($avg);
}

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................