concatenate variable to string php code example Example 1: how to add two string in php Remember dot . Example 2: add more data to variable php $a = "Hello "; $a .= "World!";