=1)){ //Update Price File if (($asx_market!='ASX')AND($asx_market!='')){$market_folder=strtolower($asx_market).'/';}else{$market_folder='';} //path from plugins/austocks folder to uploads/austocks $price_folder=ABSPATH .'/wp-content/uploads/ausstocks/'. strtolower($asx_code); if (!file_exists($price_folder)) { mkdir($price_folder, 0755, true); } //Get the file $array = file_get_contents('https://ausstocks.com.au/wp-content/uploads/austocks/json/'.$market_folder.'price_'.strtoupper($asx_code).'.txt'); //Store in the filesystem. $fp = fopen($price_folder.'/price.txt', "w"); fwrite($fp, $array); fclose($fp); }else{ $array = file(site_url().'/wp-content/uploads/ausstocks/'.$asx_code.'/price.txt'); } $array=substr(str_replace('\r\n','',$array[0]),1,-1); $output=unserialize($array); $resultarray = $output[strtoupper($asx_code)]; return ($resultarray); } ?>