lopes_andre Posted October 9, 2010 Share Posted October 9, 2010 Hi, I need to post to a form with cURL. I'am sending strings in Headers format... There are some documentation or some function that translates from the human readable format to the Headers format? For example: Human readable format: Vendo bicicleta. Como nova. Headers format: Vendo%20bicicleta.%20Como%20nova. The problem is not the spaces but more the accents. I write in Portuguese. Can you give me some clue? Best Regards, Link to comment https://forums.phpfreaks.com/topic/215488-how-to-convert-strings-to-headers-format/ Share on other sites More sharing options...
jl5501 Posted October 9, 2010 Share Posted October 9, 2010 the urlencode() function should provide what you need Link to comment https://forums.phpfreaks.com/topic/215488-how-to-convert-strings-to-headers-format/#findComment-1120524 Share on other sites More sharing options...
PaulRyan Posted October 9, 2010 Share Posted October 9, 2010 jl5501: You are right, but rawurlencode() also encodes spaces with %20, unlike urlencode() The following is your friend $string = 'Vendo bicicletä. Como novä.'; $headerFormat = rawurlencode($string); The ä are just tests, try it out. Regards, Paul. Link to comment https://forums.phpfreaks.com/topic/215488-how-to-convert-strings-to-headers-format/#findComment-1120525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.