php concatinate strings code example
Example 1: php concat
$a = "hello";
$b = "world";
$c = $a . " " . $b;
echo $c;
Example 2: add more data to variable php
$a = "Hello ";
$a .= "World!";
Example 3: php concat variable and string
<?php
$name = "Paul";
$age = 26;
echo "My name is {$name}, I'm {$age} years old ";
Example 4: php concatenate variables to function
public function getAvg(string $var) {
$min = $this->{$var._min};
$max = $this->{$var._max};
$avg = (($min + $max) / 2);
return round($avg);
}