[eluser]Todlerone[/eluser]
Hello everyone and TY in advance. I'm trying to use a ternary condition to establish some output in a view. However, I keep getting errors. I have three possible prefixes to a word. What I'm trying to do is determine if each one is set in the database then append them together with a space between them. Example: Lt Sup Occipital or Lt Ant Occipital.
My variables are sagittal, axial or coronal. Here is a sample of what I have tried in my view.
Code:
<?php $location = ($plan['sagittal']) ? $plan['sagittal']." " : //nothing ?>
<?php $location .= ($plan['axial']) ? $plan['axial']." " : //nothing ?>
<?php $location .= ($plan['coronal']) ? $plan['coronal']." " : //nothing ?>
....then echo out $location
TY for any help