leocrj 0 Denunciar post Postado Abril 28, 2005 $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";Alguém poderia me dizer o que faz o "?" e ":" Compartilhar este post Link para o post Compartilhar em outros sites
buenoweb 7 Denunciar post Postado Abril 28, 2005 É outra forma de usar o if.$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";se a variável thevalue for diferente de |"", atibua à variável thevalue """.thevalue.""", se não, atribua o valor NULLoutro ecxemplo, mais simples:$valor = ($var == 2) ? "teste1" : "teste2";se a variável var for igual a 2, atribua à variável valor o valor "teste1", se não, atribua "teste2" Compartilhar este post Link para o post Compartilhar em outros sites