How to assign the contents of a file to a variable in PHP

前端 未结 7 666
Happy的楠姐
Happy的楠姐 2020-12-30 07:22

I have a document file containing HTML markup. I want to assign the contents of the entire file to a PHP variable.

I have this line of code:

$body = in

7条回答
  •  囚心锁ツ
    2020-12-30 07:36

    Try using PHP's file_get_contents() function.

    See more here: http://php.net/manual/en/function.file-get-contents.php

提交回复
热议问题