php - if else shorthand solution -



php - if else shorthand solution -

i not sure if next validation can done if shorthand.

//if $error set, echo $errro or echo blank string. (isset($error)) ? echo $error:echo '';

i know got wrong, here can help me right code? lot.

echo isset($error) ? $error : '';

php if-statement shorthand

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -