I have an end of a link set, but I only want a portion to be used UNLESS the size of an array is greater than 1.
$closeLink='</a>'.'<a target="_blank" href="'.implode('" rel="lightbox['.
$post->ID.']" class="single_image" title="'.$lightHtml.'<br /><a href="'.
$desclinkurl.'">'.$desclink.'</a>"></a><a href="',$custgalarr).'"
rel="lightbox['.$post->ID.']" class="single_image" title="'.$lightHtml.'<br /><a
target="_blank" href="'.$desclinkurl.'">'.$desclink.'</
a>"></a>';
So everything after the part shown isolated below needs to only show if the size of the array $custgalarr is greater than 1:
$closeLink='</a>'
I figure I need to use something like this after the closing a tag
if (sizeof($custgalarr) > 1){
Help me out, thanks in advance!
In PHP it's
if (count($custgalarr) > 1)
in PHP:
count()
http://php.net/manual/en/function.count.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With