Show Value Only If Not Empty - PHP -


I have found a form where some fields are optional I then display these areas.

I am trying to show only one value from my database if there is a value. Otherwise, do not show anything.

If there is a value, it needs to be displayed -

  & lt; div class = 'category' style = 'font-size: 20px; Background color: f2f2f2 '; ". $ Line ['project_category']" & lt; / Div & gt;   

Do I 'if (strlen ($ prjcat)> 0)'?

Thank you!

If you are checking a if statement that the value is empty :

  if (empty ($ line ['project_category'])) {echo "


Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -