samedi 18 mars 2017

¿How to use if and else inside echo statement?

I've heard something about ternary operator but I kind of begginer and don't know how to use it, I'm trying to make this:

                   echo    '<div>
                           '.if(LoginCheck($this->db) == true):.'
                            <span class="option1"></span> 
                           '.else:.'
                           <span class="option1"></span>                             
                           '.endif;.'
                           </div>';

Aucun commentaire:

Enregistrer un commentaire