html - PHP Coding $ variable -
i want place html code inside $ variable. so, have "sidebar.html" file, has got various "{$test1}" "{$test2}" , on.
i can't work out how add html code that.
so in short, want have {$fleet} in first html file, , in php code, need like
$fleet = <div class="sidebar-content"> <div class="sidebar-header">find fleet</div> <div class="sidebar-link"> <a href="./index.php?a=profile&u=obsidianfleet">obsidian fleet</a> <a href="./index.php?a=profile&u=startrekfreedom">star trek freedom</a> </div> <div class="sidebar-link"> </div> </div> }
thanks in advance
you should use nowdoc:
$fleet = <<<'php_str' <div class="sidebar-content"> <div class="sidebar-header">find fleet</div> <div class="sidebar-link"> <a href="./index.php?a=profile&u=obsidianfleet">obsidian fleet</a> <a href="./index.php?a=profile&u=startrekfreedom">star trek freedom</a> </div> <div class="sidebar-link"> </div> </div> php_str;
Comments
Post a Comment