PHP Using ($_GET['url']) and then displaying that json data? -
<?php function get_stuff() { ($_get['http://****removedforsecuritypurposes****.repairshopr.com/api/v1/tickets?api_key=****removedforsecuritypurposes****']); echo $_get; } get_stuff(); ?> /* yes, pointless closing tag, i'm cool that. */
for reason when run code output i'm getting "array" , can't figure out why? know array i'm getting url thought print in whatever format in? missing something?
thanks in advance!
you cannot pass website url $_get.
you should use file_get_contents()
$content = file_get_contents('http://your_url');
if have valid json can convert array.
$data = json_decode($content, true);
then print it,
echo '<pre>'; print_r($data);
Comments
Post a Comment