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

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

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