I'm having some trouble replacing the "+" sign with its urlencoded string of "%2B". How can I do this?

This is what I've tried:

Text Entered into text box:

```
plus(+)

```

I then urlencode the string:

```
$string = urlencode($string);

```

String now looks like:

```
plus%28+%29

```

I want to have the "+" urlencoded, or else when I urldecode() the data to display in browser I end up with:

```
plus( ) 

```

because urldecode() interprets the "+" to be a space.

I tried using php's str\_replace() but I keep getting a "NULL" returned as the value for "$new\_string":

```
$new_string = str_replace('+', '%2B', $string);

```

Any ideas? 

Thanks in advance!