WEB TUTORIALS
PRACTICE EXAMPLES
HTML REFERENCES
CSS REFERENCES
PHP REFERENCES

How append a string in PHP

Topic: PHP / MySQLPrev|Next

Answer: Use the PHP String Operators

There's 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.

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

See the PHP operators tutorial to learn more about operators.


Related FAQ

Here are some more FAQ related to this topic:

Your Feedback:

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