[ create a new paste ] login | about

Link: http://codepad.org/FGtxSlX3    [ raw code | output | fork ]

PHP, pasted on Nov 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$content = '\tThis variable is not set by me.\nCannot do anything about it.\n';



echo "input:\n======\n$content\n\noutput:\n=======\n",

    preg_replace(
        '/\\\\([nrtvf\\\\$"]|[0-7]{1,3}|\x[0-9A-Fa-f]{1,2})/e',
        'stripcslashes("$0")', $content
    )

;


Output:
1
2
3
4
5
6
7
8
input:
======
\tThis variable is not set by me.\nCannot do anything about it.\n

output:
=======
	This variable is not set by me.
Cannot do anything about it.


Create a new paste based on this one


Comments: