Saulius Antanavicius
Saulius Antanavicius

Reputation: 1381

PHP printing raw string

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

Upvotes: 1

Views: 10273

Answers (2)

Hossein
Hossein

Reputation: 4137

Use the var_export function:

echo var_export($s, true);

Upvotes: 1

Benjie
Benjie

Reputation: 7946

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

$headers = str_replace(array("\r","\n"),array("\\r","\\n"),$headers);

Upvotes: 3

Related Questions