file_put_content如果不存在则创建文件?

$html = file_get_contents('http://www.test.com);
$file = '/Applications/MAMP/htdocs/test.html';
file_put_contents($file,$html);

Does file_put_content create the file test.html when file doesn't exists?

yes.

as per php documentation:

If filename does not exist, the file is created.

illness_img/2021063015481521.png文件路径是这样。但是创建的位置确实illness_img/20210630/sad12sa1d3sa2d2sad12asd1a2sd.png,真是服了,这个方法还不返回文件的路径 这让我如何操作