Set JavaScript file to a variable in PHP -


okay i'm trying set javascript document variable in php?

essentially i'm setting wifi speed calculate in javascript document variable,so can save variable value in database other information instance.

the javascript code pretty long don't know if should copy whole code in , set equal variable or if there's syntax set variable.

i've seen:

<script type="text/javascript" src="file.js"></script> 

online calling javascript file not sure how value , store in variable.

you

$js = file_get_contents( 'http://www.example.com/javacsript.js');  $value = trim( str_replace( array( "document.write('", "');"), '', $js));  echo $value; 

hope you


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -