file_get_contents takes the php content! and i need the source code in html

后端 未结 1 1037
南方客
南方客 2021-01-27 19:07

I\'m trying to take the html content of my .php file with file_get_contents but i can not manage it. It takes .php content no matter what i do so I hope you understand and can h

1条回答
  •  灰色年华
    2021-01-27 19:24

    If you want to get the output in a string, you can use the following code:

    ob_start();
    include '/path/to/file.php';
    $content = ob_get_clean();
    

    0 讨论(0)
提交回复
热议问题