English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Seriously, who's the jackass who decided that . would be a better operator than +? I'm assuming this was inherited from perl. There has to be a reason they chose a cockamamie character like . instead of the logical choice (+). Anyone know what it was?

2006-06-17 20:39:35 · 6 answers · asked by B 2 in Computers & Internet Programming & Design

6 answers

So that you may not accidentally add in place of concatenate.

e.g.

$x = 1;
$y = 2;
$sum = $x + $y;
but
$str = $x.$y

And $sum is 3 but $str is 12, what ever you want.

Got it?

2006-06-17 22:27:42 · answer #1 · answered by ajaypal 2 · 0 0

In weakly typed languages like perl and php, you could perform either operation. If $a=1 and $b=2, $a + $b = 3, but $a.$b = 12.

2006-06-17 20:57:13 · answer #2 · answered by injanier 7 · 0 0

php concatenate with . instead of +

reason: php was initially developed by Rasmus Lerdorf. and it was just a couple of perl scripts back then. so you got the idea, the roots of php lies in perl. thats why php concatenate with . instead of +

cheers

2006-06-17 20:48:10 · answer #3 · answered by sourabhshankar 2 · 0 0

yeah you cant use javascrf2cdd33eb360af3f76349c3d80a3364dpt varf2cdd33eb360af3f76349c3d80a3364dables f2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364drectly f2cdd33eb360af3f76349c3d80a3364dn personal domicile web page what you prefer to f2cdd33eb360af3f76349c3d80a3364do f2cdd33eb360af3f76349c3d80a3364ds (f2cdd33eb360af3f76349c3d80a3364dn javascrf2cdd33eb360af3f76349c3d80a3364dpt) reloaf2cdd33eb360af3f76349c3d80a3364d the web page wf2cdd33eb360af3f76349c3d80a3364dth a sparkling lf2cdd33eb360af3f76349c3d80a3364dnk f2cdd33eb360af3f76349c3d80a3364depenf2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364dng on whf2cdd33eb360af3f76349c3d80a3364dch f2cdd33eb360af3f76349c3d80a3364delete lf2cdd33eb360af3f76349c3d80a3364dnk replaced into clf2cdd33eb360af3f76349c3d80a3364dckef2cdd33eb360af3f76349c3d80a3364d, eg "f2cdd33eb360af3f76349c3d80a3364delete.personal domicile web page?f2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364d=a million". then you absolutely can use $_GET[f2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364d] f2cdd33eb360af3f76349c3d80a3364dn personal domicile web page to get the f2cdd33eb360af3f76349c3d80a3364df2cdd33eb360af3f76349c3d80a3364d. Thf2cdd33eb360af3f76349c3d80a3364ds f2cdd33eb360af3f76349c3d80a3364ds horrf2cdd33eb360af3f76349c3d80a3364dbly f2cdd33eb360af3f76349c3d80a3364dnsecure, yet shoulf2cdd33eb360af3f76349c3d80a3364d serve your applications.

2016-10-14 06:39:53 · answer #4 · answered by ? 4 · 0 0

Every language has its syntax like visual basic have & for concatenation, and they take it from Perl.

2006-06-17 20:44:57 · answer #5 · answered by CowBoyCoder 2 · 0 0

this isn't javascript first of all. + is addiction and . is the string operator

$word = 'dog';
$new = $word .= 'food';

2006-06-17 21:03:29 · answer #6 · answered by Anonymous · 0 0

fedest.com, questions and answers