Capture javascript output in PHP ob_get_clean()?

22 Views Asked by At

I'm trying to allow JS to execute inside PHP's output buffering.

I have tried declaring ob_start and then referencing the javascript, then getting the contents

<?php
ob_start(); ?>
<script language="Javascript" src="https://www.ip2phrase.com/j?template=.   <ISP>"></script>
<?php
$visitorISPW = ob_get_clean();

I was hoping to get the result of the JS src, which is a document.write.

Instead I get the full results of the script. The end result of the script is just javascript executing again from the source URL.

I would prefer the JS to execute, and then grab the result in PHP.

0

There are 0 best solutions below