I solved the problem thanks to suggestion on Add content to a new open window
On the page I want to debug, where I need to, I add following code (if session is not started I need to add "session_start();" ):
<?php
$_SESSION['varsLog'] = "<pre>".htmlspecialchars(print_r($myVariablesArray))."</pre>\n";
?>
<script type="text/javascript">
$(document).ready(function () {
var OpenWindow = window.open("/empty.html", "phpLog", 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=1400,height=640');
});
</script>
and then I have the empty.html page on the root of my domain:
<?php session_start(); if (!isset($_SESSION['varsLog'])) { exit(1); } ?>
<html><body>
<?php
echo date(DATE_RFC822);
$refer = $_SERVER['HTTP_REFERER'];
echo "<br><br>Variables from <a href=".$refer.">".$refer."</a><br><br>";
echo $_SESSION['varsLog'];
unset($_SESSION['varsLog']);
?>
</body></html>
This way I can add the first code snippet to any page I need to debug, every time I load those pages the new window I previously opened will be just updated with the variables from the last page loaded, with a useful referring url and time stamp to be sure.
Thanks for help to everyone!