0

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

1
Contributor
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Spider X
0

Okay, I may have asked for the wrong thing. ??

How can I convert: This is a note
To: This%20is%20a%20note

??

Thanks
-Kevin

0

Well it looks like rawurlencode is the answer!

$note  = rawurlencode ( $note );
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.