using php isset to display image and link to popup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oxgman
    New Member
    • May 2014
    • 1

    using php isset to display image and link to popup

    Hello, I feel like I am beating my head against a brick wall on this... I am trying to detect if an array is empty in order to display or not display an image with popup containing a youtube embedded video.

    Code:
    <?php if (isset($teamMetas['video_code'])) { echo <a href="#pop_up_<?php echo $team->ID; ?>" class="fancybox-media"  rel="media-gallery"><img src="<?php bloginfo('template_url'); ?>/images/play-button.png" width="42px" height="42px"/></a>;}?>
    I am sure I am doing this completely wrong but I cannot seem to crack it. Any advice would be greatly appreciated!
    Last edited by Rabbit; May 23 '14, 12:16 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if an array is empty, its size is 0 and empty() returns true.

    Comment

    Working...