Foser Posted July 2, 2007 Share Posted July 2, 2007 In some functions like mail there is a repeated variable. and most of them have .= like $var1 .= "text"; what does the .= mean? Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/ Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 caternation addingone.toanother <?PHP $a.="HELLO "; $a.=" THERE I AM"; $a.=" REDARROW"; echo $a; ?> Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/#findComment-287864 Share on other sites More sharing options...
Foser Posted July 2, 2007 Author Share Posted July 2, 2007 so its like one big variable. Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/#findComment-287867 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 there you go nearly right. http://karma.nucleuscms.org/item/27/catid/6 Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/#findComment-287872 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 As we have already seen in the Echo Lesson, the period "." is used to add two strings together, or more technically, the period is the concatenation operator for strings. PHP Code: $a_string = "Hello"; $another_string = " Billy"; $new_string = $a_string . $another_string; echo $new_string . "!"; Display: Hello Billy! link http://www.tizag.com/phpT/operators.php Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/#findComment-287879 Share on other sites More sharing options...
Yesideez Posted July 2, 2007 Share Posted July 2, 2007 The .= operator is handy if you have a loop running and want to repeatedly add something onto the end of a string. <?php $txt=''; for ($i=0;$i<5;$i++) { $txt.='*'; } echo $txt; ?> The above is exactly the same as this: <?php $txt=''; for ($i=0;$i<5;$i++) { $txt=$txt.'*'; } echo $txt; ?> All the above does is make a string containing "*****" (five stars) Link to comment https://forums.phpfreaks.com/topic/58057-solved-what-is-it-exacly/#findComment-287882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.