Using php, I extract data from xml files:

На рынке жилья затишье Поведение рынка недвижимости в прошлом году было довольно нестандартным. Наверное, этим объясняются противоречивые прогнозы, которые давали специалисты на текущий год. Какова же реальная ситуация на рынке жилья сегодня? Об этом рассказывает руководитель д Автор: 

At the same time, there is no information about the author in xml ... How to make sure that the author is not displayed (so that the <p> tag processing does not go through)? The data about the author is as follows:

 <p>Автор: <?=$sAutorArticle?></p> 

those. using html and php. Implemented in php the ability to hide empty tags using LIBXML_NOBLANKS. Nevertheless, the author is a string html-th, and in any case will be displayed, even if the corresponding tag is missing.

    2 answers 2

     if($sAutorArticle != "") echo'<p>Автор: '.$sAutorArticle.'</p>'; 
    • <p> Author: <? = $ sAutorArticle?> </ p> is still processed. You can somehow when checking the conditions: if ($ sAutorArticle! = "") Echo '<p> Author:'. $ SAutorArticle. '</ P>'; disable the <p> tag display text about the author? - Nerox
    • need to replace the output as I wrote - Maksym Prus
    • but I understood everything)) ATP)) - Nerox
     if($sAutorArticle == "") { автора нет (нет <p>) } else { автор есть (есть <p>) }