Creating a URL's from comma delimited field

How can I convert a field that contains text like this

phones,computers,laptops

into turning each word between the comma’s into url’s for example
making phones http://yoururl.com/phones or http://yoururl.com/computers

etc…

thanks


$categories = 'phones,computers,laptops';
$categories = explode(',', $categories);

foreach($categories as $cat) {
    $cat = trim($cat);
    echo "http://yoururl.com/$cat";
}

that worked thanks man:D