PHP - Bits & Pieces

PHP programming codes and scripting are discussed in the manner of use and relevance. Examples of PHP syntax and scripting are presented in concise writups for better understanding.

Monday, May 26, 2008

Using PHP to add to strings or join string with string variables

In PHP programming, one constantly has to be reminded of how to add a string of text to an existing one dynamically. We first create a line of string text and assign it to a string variable. We add onto the string in the following manner:

$instn = $instn . "No shaping is needed from waist to underarm as their widths are the same.\n\n";

Remember to add the new string to the variable with '.' or else the new text will replace all previous text in the variable.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home