How To Include Variables in Double-Quoted Strings in PHP?
Submitted by: AdministratorVariables included in double-quoted strings will be interpolated. Their values will be concatenated into the enclosing strings. For example, two statements in the following PHP script will print out the same string:
<?php
$variable = "and";
echo "part 1 $variable part 2 ";
echo "part 1 ".$variable." part 2 ";
?>
This script will print:
part 1 and part 2
part 1 and part 2
Submitted by: Administrator
<?php
$variable = "and";
echo "part 1 $variable part 2 ";
echo "part 1 ".$variable." part 2 ";
?>
This script will print:
part 1 and part 2
part 1 and part 2
Submitted by: Administrator
Read Online PHP Job Interview Questions And Answers
Top PHP Questions
☺ | What is the difference between PHP4 and PHP5? |
☺ | What is the difference between characters \023 and \x23? |
☺ | How To Download and Install PHP on Windows? |
☺ | What are the difference between abstract class and interface? |
☺ | How many ways we can pass the variable through the navigation between the pages? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |