PHP String Operators - PHP Tutorial 35

Veröffentlicht am: 12 September 2019
auf dem Kanal: ChidresTechTutorials
1,076
16

Notes for You::PHP String Operators - PHP Tutorial 35

PHP has two string operators:
. (Concatenation operator)
- converts the LHS and RHS operands to the string format and
- forms a new string by combining them

.= (short hand concatenation assignment operator)
- converts the LHS and RHS operands to the string format and
- forms a new string by combining them and
- assigns the resultant string to left hand side variable

Note:
- It is recommended to add space before and after the string operators.


Example Code:

echo "Manjunath" . "Chidre"; // "ManjunathChidre"
echo "<br/>";
echo "Manjunath " . "Chidre"; // "Manjunath Chidre";
echo "<br/>";
echo "Manjunath" . " Chidre"; // "Manjunath Chidre";
echo "<br/>";
echo "Manjunath" . " " . "Chidre"; // "Manjunath Chidre";
echo "<br/>";
echo "<br/>";

echo "Manjunath" . "Chidre"; // "ManjunathChidre"
echo "<br/>";
echo "Score: " . 2; // "Score: 2"
echo "<br/>";
echo 2 . "Score: "; // "2Score: "
echo "<br/>";
echo 2 . 2;
echo "<br/>";
echo "<br/>";
echo "Score: " . 2 + 2; // 0 + 2 = 2
echo "<br/>";
echo "Score: " . (2 + 2); // "Score: 4"
echo "<br/>";
echo 2 + 2 . "Score: "; // "4Score: "
echo "<br/>";
echo "<br/>";

$myName = "Manjunath";
echo $myName; // Manjunath
echo "<br/>";
$myName .= " Chidre"; // $myName = $myName . " Chidre";
echo $myName; // Manjunath Chidre
echo "<br/>";
$myName .= " Aurad"; // $myName = $myName . " Aurad";
echo $myName;
echo "<br/>";

Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.






=========================================

Follow the link for next video:
PHP Tutorial 36 - Special Operators in PHP | PHP Special Operators Tutorial
   • PHP Special Operators - PHP Tutorial 36  

Follow the link for previous video:
PHP Tutorial 34 - Bitwise Operators in PHP | PHP Bitwise Operators Tutorial
   • PHP Bitwise Operators - PHP Tutorial 34  

=========================================

PHP Tutorials Playlist:-
   • PHP Tutorials  

=========================================
Watch My Other Useful Tutorials:-

MySQL Tutorials Playlist:-
   • MySQL Tutorials  

HTML Tutorials Playlist:-
   • HTML Tutorials  

CSS Tutorials Playlist:-
   • CSS Tutorials  

JavaScript Tutorials Playlist:-
   • JavaScript Tutorials  

=========================================

► Subscribe to our YouTube channel:
   / chidrestechtutorials  

► Visit our Website:
https://www.chidrestechtutorials.com

=========================================
Hash Tags:-
#ChidresTechTutorials #PHP #PHPTutorial


Auf dieser Seite können Sie das Online-Video PHP String Operators - PHP Tutorial 35 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer ChidresTechTutorials 12 September 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,076 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!