String and variable concatenation in php

后端 未结 6 919
自闭症患者
自闭症患者 2021-01-13 07:01

I am new to PHP and I want to concatenate a string with a variable without any space. I am using a variable $var and a string which is given below.

         


        
6条回答
  •  南笙
    南笙 (楼主)
    2021-01-13 07:50

    You can use { } to use variable's value in a string.

    $result = "Name\Branch\\{$var}";
    

提交回复
热议问题