title: Separate multiple meta values with slashes within a $list (wordpress)
body: <p>I want to list some custom posts (wordpress) and their meta values. Everything works fine so far, but I have to work with empty values too. And I want to use slashes to separate multiple values. So here's what I have so far:</p>
  
  <pre><code>$list = '&lt;div class="clearfix vlist"&gt;
           &lt;div class="vlist-content"&gt;' ;
  
  while($wpex_query-&gt;have_posts()) : $wpex_query-&gt;the_post();
  
  global $post;
  
  $list .= '&lt;div class="vlist-item"&gt;
            &lt;div class="title"&gt;'.get_the_title().'&lt;/div&gt;
            &lt;div class="info"&gt;'
            .get_post_meta( $post-&gt;ID, 'wpex_vita_genre', true ).' / '
            .get_post_meta( $post-&gt;ID, 'wpex_vita_director', true ).' / '
            .get_post_meta( $post-&gt;ID, 'wpex_vita_role', true ).'&lt;/div&gt;
            &lt;/div&gt;';
  endwhile;
  
  wp_reset_query();
  
  return $list . '&lt;/div&gt;&lt;/div&gt;';
  </code></pre>
  
  <p>Problem comes within div.info, where I want to display 3 values, separated by slashes (/). Soon as one or two values are empty I get stupid double slashes // because these characters are not conditional. I don't know how to make them appear only when there are values to separate because I can't just put an if statement into my $list. I know I know now you people who know php are just shaking heads or doing facepalms because this for sure is easy pie... could you still tell me how to solve this problem? </p>
  
  <p>Thank you!! </p>