Welcome Guest, Not a member yet? Register   Sign In
preg_replace on $this->input->post values
#1

[eluser]Unknown[/eluser]
Hi all,

I'm having a problem changing post values, preg_replace for example.

For example when I use this code:

Code:
unset($this->input->post('submit'));    
$this->input->post('constant') = preg_replace('@,@', '.', $this->input->post('constant'));
$this->db->where('id', $this->input->post('id'));
$this->db->update('form_lists_sub', $this->input->post());

I get the error: Fatal error: Can't use method return value in write context in

but when I use the method with $_POST like this it works fine:

Code:
unset($_POST['submit']);    
$_POST['constant'] = preg_replace('@,@', '.', $_POST['constant']);
$this->db->where('id', $this->input->post('id'));
$this->db->update('form_lists_sub', $this->input->post());

So I could use the normal post method but I prefer to use the codeigniter functions.

Any thoughts?

Thanks in advanced!


Messages In This Thread
preg_replace on $this->input->post values - by El Forum - 10-28-2011, 03:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB