WEB TUTORIALS
PRACTICE EXAMPLES
HTML REFERENCES
CSS REFERENCES
PHP REFERENCES
Advertisements

How append a string in PHP

Topic: PHP / MySQLPrev|Next

Answer: Use the PHP String Operators

There is no specific function to append a string in PHP. But you can use the PHP concatenation assignment operator (.=) to append a string with another string.

Let's check out the following example to understand how it basically works:

<?php
$a = "Hello";
$a .= " World!";
echo $a; // Outputs: Hello World!
?>

See the tutorial on PHP operators to learn about the operators in detail.


Related FAQ

Here are some more FAQ related to this topic:

Advertisements
Bootstrap UI Design Templates

Your Feedback:

We would love to hear from you, please drop us a line.