I'm setting the header in PHP with header('name: '.$someVariable)
, where the variable varies depends on user input.
The problem is, when I check on the returned header values, all of them are a trimmed compared to the actual result I wanted, for example, " ABCD "
becomes "ABCD"
in the returned header. Is this a normal behavior? If so, how can I disable it? Or what are some alternatives that will retain the result perfectly?
My use case: I return the user input in the header as a verification of the response returned by the server, as there can be many requests/responses going on in a short period of time, and this will help me match these requests and responses
Note: I can't use echo
because it's reserved for other tasks.