1

I want to echo this html code but unable to this
code:

<div class="cbp-item <?php echo( htmlspecialchars( $row['catName'] ) ); ?>">
            <div class="cbp-caption">
                <div class="cbp-caption-defaultWrap">
                    <img src="gallery/<?php echo( htmlspecialchars( $row['gFILE_NAME'] ) ); ?>" alt="">
                </div>
                <div class="cbp-caption-activeWrap">
                    <div class="cbp-l-caption-alignCenter">
                        <div class="cbp-l-caption-body">
                            <h4>by <?php echo( htmlspecialchars( $row['picCourtesy'] ) ); ?></h4>
                            <a href="gallery/<?php echo( htmlspecialchars( $row['gFILE_NAME'] ) ); ?>" class="cbp-lightbox cbp-l-caption-buttonRight" data-title="by <?php echo( htmlspecialchars( $row['picCourtesy'] ) ); ?>">view larger</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>

how can i echo this, like <?php echo '<div>' hellow '</div>'; ?>

Iam Srkfan
  • 197
  • 9

2 Answers2

2
echo '<div class="cbp-item '.$catName.' ">
            <div class="cbp-caption">
                <div class="cbp-caption-defaultWrap">
                    <img src="gallery/'.$gFILE_NAME.'" alt="">
                </div>
                <div class="cbp-caption-activeWrap">
                    <div class="cbp-l-caption-alignCenter">
                        <div class="cbp-l-caption-body">
                            <h4>by '.$picCourtesy.'</h4>
                            <a href="gallery/'.$gFILE_NAME.'" class="cbp-lightbox cbp-l-caption-buttonRight" data-title="by '.$picCourtesy.'">view larger</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>';

you dont need to use <?php echo( htmlspecialchars( $row['catName'] ) ); ?> if you are trying to echo the div.

AakkiRock
  • 288
  • 1
  • 4
  • 14
1

You do: <?php echo '<div>Hello</div>'; ?>

Exemple:

<?php 
echo '<p dir=rtl id="textmsg" style="color: '.$donnees['color'].';">'.$donnees['text'].'</p>';
?>