How to get Javascript var with simple html dom

I am trying to get the time_zone var seen below using simple html dom in php

<script>
var isLivePage = false;
var isToday = false;
var time_zone = '-9.5';
var page_date = '2021-04-21';
var g_sort = 'live';
</script>

from https://www.scorespro.com/soccer/england/premier-league/fixtures/ but I can't work out how to get the time_zone var

Any help would be appreicated, many thanks

1 answer

  • answered 2021-04-21 15:52 Alen Vlahovljak

    To get the script tag, you should use:

    var scriptTag = document.getElementsByTagName('script')
    

    And then do the rest on this variable...