editing how a field is output (changing commas to ) I am getting data from an outside source to populate some of my fields. It comes in as a string separated with commas. In order to display this data in a list format. I did this: 

$commaString = ($items[0]["#markup"]);
$NoCommaString = str_replace("," , "&lt;br /&gt;", $commaString);
$items[0]["#markup"] = $NoCommaString;


In field--field-MYFIELD.tpl.php. So now field displays like this:

item 1
item 2 
item 3


instead of 

item 1, item 2, item 3


Which is exactly what I want, yay! However, I'm new to Drupal and am worried I'm bypassing something or not using an API when I should be. So is there a better way to do this?
Just for security purposes I would wrap $commaString in check_plain() to get rid of any naughty characters or code that could come through.

And as for doing extremely simple things with PHP, you shouldn't have to worry about doing it the "Drupal way" too often. There are such things as PHP wrapper functions which are useful for keeping your code safe from PHP version quirks.

Also just to add, if the question were: "I want to format this CSV as a bulleted list." Then I would've suggested using a theme() function like the following:

print theme('item_list', array('items' =&gt; explode(",", check_plain($commaString))));


Because Drupal's theme layer is your friend and will help you to almost never write markup in your code. And I'm not aware of a theme function that converts a CSV string into a newline separated one. Item list is a good example of a theme function, so is a table theme.