This works:
<?php
$string = $category_short;
$pattern[0] = "/ /";
$replacement[2] = "+";
$plustext = preg_replace($pattern, $replacement, $string);
?>
This takes $category_short, e.g., "
Gossamer Threads" and creates $plustext, which would be "Gossamer+Threads".
This is for example useful when integrating Amazon web services into your categories.
Thanks Andy, for helping out.
John