PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I join strings together?


This is called concatenation, as the Latin fans out there will know this comes from the Latin 'con' for 'with' and 'catena' for 'chains', so they are chained or linked together.

That's the language lesson over. Period. In fact it's all about the period (.) or if you speak English outside of America, the stop, or full stop character.

Here's an example:
<?php
$a 
"I feel";
$b " lonely";
$isolation $a $b;
echo 
"$isolation"// I feel lonely
?>


... and that's all there is to it, simply use the '.' between the strings that you want to join together. Note that you will need to be careful with your spacing when joining strings together if you don't want characters to appear next to each other; often therefore you'll need to include a space character in your concatenation.



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

How do I reverse a string in PHP?

How do I remove space from the start of a PHP string?

Hello, Is it possible to specify a character-encoding in the filter_var function. Thank you for your reply, Jan

How do I turn a string into an array?

How can I repeat a string variable several times?



Custom Search