php heredoc
$output = <<<HTML
<p>Lorem ipsum dolor sit amet consectetur<p>
<a href="{$foobar}">click here</a>
HTML;
php heredoc
$output = <<<HTML
<p>Lorem ipsum dolor sit amet consectetur<p>
<a href="{$foobar}">click here</a>
HTML;
php variable in string
$a = '12345';
// This works:
echo "qwe{$a}rty"; // qwe12345rty, using braces
echo "qwe" . $a . "rty"; // qwe12345rty, concatenation used
// Does not work:
echo 'qwe{$a}rty'; // qwe{$a}rty, single quotes are not parsed
echo "qwe$arty"; // qwe, because $a became $arty, which is undefined
PHP Variable in String
phpCopy# php 7.*
<?php
$txt = "salt";
echo "{$txt}y";
?>
php heredoc variable substitution
echo <<<EX
<p>Game: {$data['game_name']}<br/>
the owner of the game is {$data['game_owner']}
</p>
EX;
PHP Variable in String
phpCopy#php 7.x
<?php
$taste = "ie";
echo sweet.$taste;
?>
PHP Variable in String
phpCopy#php 7.x
<?php
$prefix = "Comfort";
$suffix = "able";
echo "{$prefix}{$suffix}";
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us