Wordpress中的PHP结构

I have this code and works fine:

global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'colors', true);

I want delete characters , and insert <br /> with code like this:

echo str_replace(",", "<br />", get_post_meta($postid, 'colors', true));

But, how can I put both of codes correctly in PHP?

If I put this, it won't work:

global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'colors', true);
echo str_replace(",", "<br />", get_post_meta($postid, 'colors', true));

Try this:

<?php 
global $wp_query; 
$postid = $wp_query->post->ID; 
echo str_replace(',', '<br />', get_post_meta($postid, 'colors', true));
?>