Monday 15 August 2011

How do i open a file from different path(not the server default path) using file_put_content in php -


Is there any way different from file_put_contents I mean instead? < Blockquote>

using C / program file /../../ htdocs / test.txt c / test / test.txt

I am using the following code: $ date = current_date; $ File = "test_" $ date ".txt"; $ Contents = "testtest"; File_put_contents ($ file, $ content);

Many thanks in advance!

When you computer either you can use a relative or full path like this:

  // full path $ file = "C: /temp/test.txt"; // relative paths from C: / program files / wamp / htdocs / index.php $ file = "../../temp/test.txt";   

point to both of those files at one place

No comments:

Post a Comment