I want to concatenate the following two string, one is a dictionary and other is simple string.
I tried the following but it did not work.
$email = $data['username'] . "@gmail.com"
Tried
$email = $data['username'] . "@gmail.com"
Want the result
echo($email);
[email protected]
2
Answers
Concatenation is correct , you may check the data and key:
You need to check that $data and $data[‘username’] exist.
if $data is an object you need to use $data->username