Welcome Guest, Not a member yet? Register   Sign In
Ternary usage
#3

[eluser]cideveloper[/eluser]
I think you have to put the else statement after the ":"


Code:
<?php
$location = ($plan['sagittal']) ? $plan['sagittal']." " : "";
$location .= ($plan['axial']) ? $plan['axial']." " : "";
$location .= ($plan['coronal']) ? $plan['coronal']." " : "";
?>


Messages In This Thread
Ternary usage - by El Forum - 01-13-2011, 03:38 PM
Ternary usage - by El Forum - 01-13-2011, 03:59 PM
Ternary usage - by El Forum - 01-13-2011, 05:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB