csv - jquery Seperate list output with comas -
csv - jquery Seperate list output with comas -
i cannot output in list separated commas. output 444064451244515. need 44406,44512,44515
<?php // homecoming zip codes within given radius of given zip code // - validate post values if(isset($_post['findzip'])) { $myzip = $_post['myzip']; $radius = $_post['radius']; $api_key = $modx->getoption('zipcode_api'); $url = "https://zipcodedistanceapi.redline13.com/rest/$api_key/radius.json/$myzip/$radius/mile"; // curl stuff $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_url, $url); $response = curl_exec($ch); $response = utf8_encode($response); $zips = $modx->fromjson($response); foreach ($zips['zip_codes'] $zip) { $output .= $zip['zip_code'].split(","); } homecoming $output; } return;
as mentioned in comments above, should work:
<?php if(isset($_post['findzip'])) { $myzip = $_post['myzip']; $radius = $_post['radius']; $api_key = $modx->getoption('zipcode_api'); $url = "https://zipcodedistanceapi.redline13.com/rest/$api_key/radius.json/$myzip/$radius/mile"; // curl stuff $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_url, $url); $response = curl_exec($ch); $response = utf8_encode($response); $zips = $modx->fromjson($response); homecoming implode(',', $zips); }
jquery csv
Comments
Post a Comment