Welcome Guest, Not a member yet? Register   Sign In
Kindof a php question.. but..re: adding to arrays
#7

[eluser]xwero[/eluser]
the DRY version
Code:
$editData = array();

foreach(array('Shortcode','ListName','InjectPassword','APIusername') as $expected)
{
   if ($this->input->post($expected)) { $editData[$expected] = $this->input->post($expected); }
}

$this->service->editService($this->input->post('service_id'), $editData);


Messages In This Thread
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-22-2009, 06:50 PM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-22-2009, 07:44 PM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-22-2009, 11:37 PM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-23-2009, 06:14 AM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-23-2009, 06:49 AM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-23-2009, 06:50 AM
Kindof a php question.. but..re: adding to arrays - by El Forum - 04-23-2009, 06:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB