I can do this in Objective-C:
newNotewUTF8 = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)oldNote, NULL, (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ", kCFStringEncodingUTF8 );
Ex:
oldNote looks like this: This is a note
newNotewUTF8 comes out like this: This%20is%20a%20note
And it works out fine. I can receive the above Note in a url:
"http://www.siteurl.com/input.php?note=This%20is%20a%20note"
in my PHP script and echo it back out to the screen.
Note looks like this: This is a note
However, I need to take the php $note and use it to create a new URL. The new URL needs to be properly formatted. I need to get $note back to:
"http://www.newurl.com/something?note=This%20is%20a%20note"
How can I do the above Objective-C in PHP?
Thanks
-Kevin