2Answers
Answer

dirname(__FILE__) will return:
c:\www\test\script\new\
you need c:\www\test\html\index.html
so you need to up to 2 levels, you can do it with .. symbol in path:
c:\www\test\script\new\..\..\ = c:\www\test\
now you can add necessary part of path:
dirname(__FILE__).'../../html/index.html'

  • 9
Reply Report
file_put_contents("../../index.html", $html);

easy - simple

EDIT: You have to access creat_html.php directly, or this solution won't work !

  • 6
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions