Grab the RSS feed

Concatenation in PHP

The easiest one operation in PHP is the concatenation operation.

This is need only one dot operator for the concatenation .Whenever we need the concatenation it tooks the simple dot and append the variable we need.

The below code simply illustrates the two methods of Concatenation.

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > 
< html xmlns="http://www.w3.org/1999/xhtml" > 
< head > 
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" / > 
< title > concatenation< /title > 
< /head > 

< body > 
< ?
$var1=' I am';
$var2=' a';
$var3=' boy';
echo $var1.$var2.$var3;
echo "< br/ > ";
/************otherwise we can use like the below operation**************/
$var4=' Hello ';
$var4.='world';
echo $var4;

? > 
< /body > 
< /html > 



Leave the comments to improve ourself…..

Click Here to download as PDF Format

0 comments:

  •  
    Real Time Web Analytics