Multiple responses from function

symondamy

New Member
I'm trying to have this function return multiple results in array(?). So basically instead of running \[code\]lookup("354534", "name");\[/code\] and \[code\]lookup("354534", "date");\[/code\] mutiple times for different results, how can I return both name & date from that function, then echo it out so I only have to use the function once?\[code\] function lookup($data, $what) { $json = file_get_contents("http://site.com/".$data.".json"); $output = json_decode($json, true); echo $output['foo'][''.$what.'']; }\[/code\]Thanks!
 
Back
Top