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,

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.