if else short hand failed in PHP -


<input type="submit" value="<? get_the_category( $id )[0]->name == 'english' ? echo 'find' : echo 'encontrar'; ?>"> 

not sure problem here, have problem doing shorthand of if else condition.

please ensure can't use echo way since has no return type.

you can try either of these:

<?php echo (get_the_category( $id )[0]->name == 'english') ? 'find' : 'encontrar'; ?> 

or

<? get_the_category( $id )[0]->name == 'english' ? print 'find' : print 'encontrar'; ?> 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -