Tools, FAQ, Tutorials:
Including Variables in Double-Quoted Strings in PHP
How To Include Variables in Double-Quoted Strings?
✍: FYIcenter.com
Variables 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\n"; echo "part 1 ".$variable." part 2\n"; ?>
This script will print:
part 1 and part 2 part 1 and part 2
⇒ Ways to Include Variables in Double-Quoted Strings in PHP
⇐ Escape Sequences in Double-Quoted Strings in PHP
2016-10-13, 1426👍, 0💬
Popular Posts:
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How to run PowerShell Commands in Dockerfile to change Windows Docker images? When building a new Wi...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...