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

[eluser]Phil Sturgeon[/eluser]
Don't see a need to push them in here. Why not just use basic array syntax.

Code:
$editData = array();

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

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

Does the exact same thing.


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