3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $response = '{"data":[{"access_token":"EAAby7f21xKABALPCThZC63i4LZAHZC7MaYbQ0E5gN","id":"515968102105625"},{"access_token":"EAAby7f21xKABAK0zyfHCVNBE0Nn3g1XZCWuXzZA4T","id":"1338263602879836"}],"paging":{"cursors":{"before":"NTE1OTY4MTAyMTA1NjI1","after":"MTMzODI2MzYwMjg3OTgzNgZDZD"}}}'; if (preg_match_all('#"access_token":[^"]*"([^"]*)"#', $response, $datos)) { $mp = $datos[1]; } else { // Tipo array con clave error. $mp = array('error' => 'No existen Access Tokens'); } $cast = implode(',',$mp); foreach($mp as $P){ $page = $P[0]; $token2 = $P[1]; } echo $token2."<br/>"; echo $page; ?>
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
A<br/>E