Jump to content

[SOLVED] Ternary operator syntax


graham23s

Recommended Posts

Hi Guys,

 

this code is giving me a T_ECHO error can anyone look at the syntax for me

 

code:

 

           $is_this_admin = ($admin == 'Site Administrator') ? echo '[<a class="altlink" href="edit.php?id='.$id.'&editedby='.$upper.'"><b>EDIT</b></a>]-[<a class="altlink" href="delete.php?id='.$id.'"><b>DELETE</b></a>]'; : echo "";

 

am i allowed to have an echo in this type of function at all?

 

thanks guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/67638-solved-ternary-operator-syntax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.