I'm trying to convert this PHP function to Objective-C. I can just barely read PHP to figure out what the code does. Came across this line and stopped:
$nr = (strlen($nr)-3>0)?substr($nr, 0, strlen($nr)-3):"";
What do the ?
and :
do here? I read the documentation to see what strlen
and substr
do but haven't been able to figure out how this comes together and what the new value of $nr
is.