Jump to content

How to convert strings to Headers format?


lopes_andre

Recommended Posts

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,

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.