aron4588 Posted June 28, 2010 Share Posted June 28, 2010 Hey i need help, right now my script connect to an api and send a sms, 1 number at a time, I want it to pull from a local sql db then repeat the response for each number in the db! `$data['post'] = array ( '_rnr_se' => $rnrse, 'phoneNumber' => '1234567890', 'text' => 'This is a test SMS!', 'id' => '' ); // Send the SMS $response = xcurl::fetch('api.phonegateway.com/', $data); // Evaluate the response $value = json_decode($response['data']);` Link to comment https://forums.phpfreaks.com/topic/206033-need-help-with-array/ Share on other sites More sharing options...
helptar Posted June 28, 2010 Share Posted June 28, 2010 Just one way you could do this.. not the best IMHO, but would work. $numbers = array('15555555555', '15555555556', '15555555557'); foreach($numbers as $k => $v){ $data['post'] = array ( '_rnr_se' => $rnrse, 'phoneNumber' => $v, 'text' => 'This is a test SMS!', 'id' => '' ); // Send the SMS $response = xcurl::fetch('api.phonegateway.com/', $data); // Evaluate the response $value = json_decode($response['data']); } Link to comment https://forums.phpfreaks.com/topic/206033-need-help-with-array/#findComment-1078078 Share on other sites More sharing options...
aron4588 Posted June 28, 2010 Author Share Posted June 28, 2010 how about adding a db into the mix? Link to comment https://forums.phpfreaks.com/topic/206033-need-help-with-array/#findComment-1078079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.