3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Define constants define('ADMIN_USER', 'aperry'); define('ADMIN_PASS', 'c0r5x0AP'); define('LIST_ID', '103'); $my_array = array(); $my_array[0]['id']= "248509"; $my_array[0]['number1']= "9255574774"; $my_array[0]['number2']= ""; $my_array[0]['first_name']= "JENNIFER"; $my_array[0]['last_name']= "PROVENZANO"; $my_array[0]['state']= "NV"; $my_array[0]['city']= "HENDERSON"; $my_array[0]['zip']= "89014"; $my_array[1]['id']= "248513"; $my_array[1]['number1']= "9255574774"; $my_array[1]['number2']= ""; $my_array[1]['first_name']= "marsha"; $my_array[1]['last_name']= "banks"; $my_array[1]['state']= "TX"; $my_array[1]['city']= "Dallas"; $my_array[1]['zip']= "75216"; $my_array[2]['id']= "248527"; $my_array[2]['number1']= "9255574774"; $my_array[2]['number2']= ""; $my_array[2]['first_name']= "Mary"; $my_array[2]['last_name']= "Lugo"; $my_array[2]['state']= "AZ"; $my_array[2]['city']= "Yuma"; $my_array[2]['zip']= "85364"; // Set POST variables foreach ($my_array as $key => $value){ echo $value['id']; /* $url = "http://69.195.39.29/vicidial/non_agent_api.php"; $fields = array( // Login and function calls 'user' => ADMIN_USER, 'pass' => ADMIN_PASS, 'function' => 'add_lead', 'format' => 'text', 'list_id' => LIST_ID, 'source' => 'adminweb', // Lead Data 'phone_code' => '1', 'phone_number' => $value['number1'], 'first_name' => $value['first_name'], 'last_name' => $value['last_name'], 'state' => $value['state'], 'city' => $value['city'], 'zip' => $value['zip'], // Settings 'dnc_check' => 'Y', 'add_to_hopper' => 'Y', 'hopper_priority' => '99', 'vendor_lead_code' => $value['id'] ); if($number2 != ''){ $fields['alt_phone'] = $number2; } // Url-ify the data for the POST $fields_string = ''; foreach($fields as $key => $value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); echo $url.$fields_string.PHP_EOL;*/ }
based on 9l6sh
Output for 5.3.21 - 7.2.0
248509248513248527