Export Page Attribute List

Permalink
I have a page attribute called "Colour" which is a check box.

If I display the contents of that attribute to a page using getAttribute('Colour')
it exports as a string i.e. "Red Blue Green"

Is there a funtion which would export this as a list i.e. "<li>red</li><li>Blue</li><li>Green</li>"

Thank you for your time

novelnova
 
webinstinct replied on at Permalink Best Answer Reply
webinstinct
PHP will do that for you.

[code] echo "<li>".str_replace(" ","</li><li>,",$strAttribute)."</li>";
cryophallion replied on at Permalink Reply
For future reference, if you want to turn this into an array you can parse through, you would use the explode command:

[code]
<?php $color_array = explode(' ',$color_string);?>
[code]