unknown os platform
Free Beginner PHP Tutorials - String Concatenation | Whats-online.info
whats-online-info

Free Beginner PHP Tutorials - String Concatenation


Free
2016:09:26 / Science and Tutorials

Learn how to concatenate two strings or variables together with dot operator in PHP. See example:-





String concatenation in PHP


String concatenation is combining two or more strings value to form one string value.

In PHP, this is achieved by using dot operator (.) and the concatenating assignment operator ('.='). The dot concatenation operator returns the concatenation of its right and left arguments while the concatenation assignment operator appends the argument on the right side to the argument on the left side.

See example:


<?php $a = "Hello "; $b = $a . "World!"; //  $b contains "Hello World!" $a = "Hello "; $a .= "World!";     //  $a contains "Hello World!" ?>













You may also like:


Leave a comment












Subscribe to get replies direct to your mailbox

Submit comment