<?php

echo urlencode("foo+bar+baz");