I`m trying to make a header with DIV-button + onclick="window.open()" then put that header code into separate PHP-file and then on each page define some variables for URL to this button and for text on it. As far as I'm understand, the link inside window.open() function must be into quotation mark, but if it's '$variable' then php-parser doesn't see a variable, and if it's "" than we have a conflict with function's own double quotation marks. So, is there a good solution?
/* in index.php */
<?php
$headerButtonLink = "nextPage.php";
$headerButtonText = "Go to Next Page";
$headerText = "Page Title";
require 'header.php'; ?>
/* in header.php */
<header>
<div class="h1"><?= $headerText; ?></div>
<div class="button" onclick="window.open('HERE I WANT TO PUT A VARIABLE ','_self',false)"><?= $headerButtonText; ?></div>
</header>