PHP Operators: Using String Concatenation Operator
Posted by Daniel at 11:03 pm
You can concatenate or add strings together using the PHP string concatenation operator represented by the period sign ( . ). refer to the examples below.
<?php // intialize variables $username = "daniel"; $domain = "danieldumas.com"; // the variable string $username and $domain can be combine using the concatenation operator $email_address = $username . '@'. $domain; //the variable $email_address now contains the value "daniel@danieldumas.com" ?>
You can also concatenate simultaneously. . Keep Reading…