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
Loading...
Related Quiz
- What are some common practices in PHP when dealing with multiple data filtering and validation?
- What are the PHP mail functions used for?
- You should always close a file in PHP using the fclose() function after you're done with it.
- Which of the following are true about constants in PHP?
- What is the difference between ereg_replace() and eregi_replace()?