I can't figure out how to get a JS array in PHP.
I need to work as follows:
var arrLow = [ { "e": "495864", "rank": "8678591", "rankmove": "<p><img src='up.php?uStyle=144'> UP 495864" }, { "e": "104956", "rank": "-", "rankmove": "<p><img src='up.php?uStyle=145'> DOWN 1" }, { "e": "0", "rank": "0", "rankmove": "<p><img src='up.php?uStyle=975'> NEW" } ]
json_decode and others just return NULL, google returns a weird way to use serialize () with HTTP POST from a JS understanding browser that really cannot work here.
Does anyone know how: x
==================================================== ==========================
Edit: Thanks guys! Didn't know it was that easy
<?php $json = file_get_contents('24d29b1c099a719zr8f32ce219489cee.js'); $json = str_replace('var arrLow = ','' ,$json); $data = json_decode($json); echo $data[0]->e; ?>
javascript arrays php
jen
source share