You are writing a PHP script and you need to combine two strings into one. How would you do this?

  • $string1 . $string2
  • $string1 + $string2
  • concatenate($string1, $string2)
  • join($string1, $string2)
To combine two strings into one in PHP, you can use the dot (.) operator. The dot operator is specifically used for string concatenation. Simply use the dot operator to concatenate the two strings together, like this: $string1 . $string2. This will create a new string that is the combination of the two original strings. Learn more: https://www.php.net/manual/en/language.operators.string.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *