$result = $data1 . $data2;
This is called string concatenation. Your example lacks a space though, so for that specifically, you would need:
$result = $data1 . ' ' . $data2;
More Related Contents:
- How i can earn variable from string in PHP? [closed]
- How to include a PHP variable inside a MySQL statement
- PHP – concatenate or directly insert variables in string
- How create an array from the output of an array printed with print_r?
- How to generate all permutations of a string in PHP?
- Mixing a PHP variable with a string literal
- Dollar ($) sign in password string treated as variable
- How to get int instead string from form?
- PHP variable interpolation vs concatenation [duplicate]
- Convert a String to Variable
- Array to String PHP?
- PHP: How to get all possible combinations of 1D array? [duplicate]
- Reading and Writing Configuration Files
- How to select first 10 words of a sentence?
- How can I access a property with an invalid name?
- Question about strpos: how to get 2nd occurrence of a string?
- How to convert string to boolean php
- Single quotes or double quotes for variable concatenation? [closed]
- Best Practices: working with long, multiline strings in PHP?
- Escape string to use in mail()
- Getting the first character of a string with $str[0]
- PHP: Split multibyte string (word) into separate characters
- Highlight keywords in a paragraph
- Search and replace multiple values with multiple/different values in PHP5?
- Explode string into array with no empty elements?
- Get the sum of all digits in a numeric string
- Storing Form Data as a Session Variable
- In PHP, is there a short way to compare a variable to multiple values?
- How does PHP compare strings with comparison operators?
- Magento – Passing data between a controller and a block