Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB