Search code examples
phppastebin

Get raw data from pastebin



I have a text on pastebin.com.
I want to get it by raw so i'm using this code in PHP :

$file = file_get_contents('http://pastebin.com/raw.php?i=1E9hZLfc');
echo $file

But it return nothing, I tried also curl but same problem.
Can you help me ?


Solution

  • If you var_dump your data, you can see it's a string with a big length. If you need to eval the code, you can try this:

    $url = "http://pastebin.com/raw.php?i=1E9hZLfc";
    $data = file_get_contents($url);
    eval('?>'.$data);
    

    The problem occurring is that it's just too long for echoing.