• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can someone "translate" this in plain English to me, please?

#2
[eluser]Craig A Rodway[/eluser]
It uses the ternary operator to set the value of $update['id'] depending on the return value of testing if $_POST['id'] is empty or not.

If $_POST['id'] is NOT empty, then $update['id'] is set to the POST'd ID; otherwise it is set to null. Think of it this way:

Code:
$result = (condition) ? IF_TRUE : IF_FALSE;

If you want to remove it, just do this:

Code:
$update['id'] = $this->input->post('id');

However:
Quote:The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

Input Class


Messages In This Thread
Can someone "translate" this in plain English to me, please? - by El Forum - 01-02-2010, 05:10 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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