1

I need to print CURL headers as a raw string, so with all of the \n and \r anyone could tell me how to?

I tried print_r and few other but it hasn't worked

2
  • You want to print on paper, print on the client browser? Commented Oct 31, 2011 at 12:48
  • You could wrap it inside a <pre> element, assuming you are using html. Commented Oct 31, 2011 at 12:51

2 Answers 2

3

I'm not really sure exactly what you're after, but you might try:

$headers = str_replace(array("\r","\n"),array("\\r","\\n"),$headers);
Sign up to request clarification or add additional context in comments.

Comments

1

Use the var_export function:

echo var_export($s, true);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.