• Help
  • Search
  • Login
  • Register
  • Home
Subscribe
Welcome, Guest. Please login or register.
Did you miss your activation email?
Celestial Star Forum > Web Development > Coding > The Concatenation Operator? (PHP)
Pages: [1]
« previous next »
  Print  
Author Topic: The Concatenation Operator? (PHP)  (Read 2024 times)
Otaku Ichise
Skogul
**
Posts: 48



View Profile WWW
The Concatenation Operator? (PHP)
« on: June 15, 2009, 06:17:06 AM »

Quote
<?php
$txt1="Hello World!";
$txt2="What a horrible day!";
echo $txt1 . " " . $txt2;
?>

Some can explain me what can we do with this Operator? and in wich cases should we call this Operator?
« Last Edit: June 15, 2009, 06:41:48 AM by Otaku Ichise » Logged

Taigatespeext
Angeling
*
Posts: 1


View Profile
Re: The Concatenation Operator? (PHP)
« Reply #1 on: October 14, 2009, 10:52:18 AM »

שלום לכולם

אני מחפש מקום עם רשימה של מפיקי אירועים
חברה שלי ואני מתחתנים ואנחנו מחפשים השכרת ציוד לאירועים
  ואטרקציות לאירועים

אנחנו נשמח לעזרה בנושא

סתם רציתי לשתף Smiley
Logged
fedekiller
Shelter
****
Posts: 208



View Profile WWW
Re: The Concatenation Operator? (PHP)
« Reply #2 on: December 04, 2009, 05:58:12 AM »

If you are still interested, concatenation is an binary operation between two strings, binary operations are the ones which affect two elements, in this case, strings, but if you think about numbers, you already know some binary operators, for example, + , -, *, /
I will use . as the concatenation operator
2 + 2 = 4
2 . 2 = 22

2 . = Bad
.2 = Bad

So basically what it does is put the second element after the first, concatenation operator in PHP is . so

Code:
$var1 = "hello";
$var2 = " world!";
$var3 = $var1.$var2; // hello world!

Hope that helps
Logged
Pages: [1]
  Print  
« previous next »
 
Jump to:  

eXTReMe Tracker
Celestial Star © Melfina 2003-2008. By using this site you agree to our terms of service
Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC | Seo4Smf v0.2 © Webmaster's Talks
Valid XHTML | Valid CSS | Top of the page
Loading...