PHP: Using the string concatenation
Posted on September 6, 2008, under PHP,
Bookmark it
Here are some simple examples of string concatenation:
<?php $first_name = 'John'; $last_name = 'Jones'; $work_area = 'IT Industry'; $text = 'His name is '.$first_name.' '.$last_name.' and he is working in the '.$work_area; // Output: His name is John Jones and he is working in the IT Industry echo $text; ?>
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- September 6, 2008
- article by Gabriel C.
- 2 comments
Related Posts
-
Format text into a SEO Friendly Stringat August 28, 2008 with 2 comments
-
How to replace multiple spaces from a string in PHPat August 29, 2008 with 2 comments
-
Checking the beginning of a string (prefix)at August 30, 2008 with 1 comment
-
Shorten a string (text)at September 3, 2008 with 2 comments
-
Validate numeric stringat May 21, 2008

2 Replies to "PHP: Using the string concatenation"
June 6, 2009 at 10:33 PM
Im guessing you meant: and he is working in the ‘.$work_in instead of $work_area;
;)
June 6, 2009 at 10:42 PM
Sure, thanks for noticing ;)