• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.