note 107106 added to function.fwrite

From: Date: Sat, 07 Jan 2012 19:21:26 +0000
Subject: note 107106 added to function.fwrite
Groups: php.notes 
Request: Send a blank email to php-notes+get-185451@lists.php.net to get a copy of this message
Hi, I am trying to create file in a subdirectory called files. I am trying this code: <?php $mypath="test"; mkdir($mypath,0777,TRUE); $filename = $mypath.'\test.txt'; $handle = fopen($filename,"x+"); $somecontent = "Add this to the file Oktavianus"; fwrite($handle,$somecontent); echo "Success"; fclose($handle); ? it is creating directory test, but it is creating files in the directory test but in the root directory where directory test is. Any how to save files in the subdirectory test? Thanks ---- Server IP: 69.147.83.197 Probable Submitter: 134.96.82.182 ---- Manual Page -- http://www.php.net/manual/en/function.fwrite.php Edit -- https://master.php.net/note/edit/107106 Del: integrated -- https://master.php.net/note/delete/107106/integrated Del: useless -- https://master.php.net/note/delete/107106/useless Del: bad code -- https://master.php.net/note/delete/107106/bad+code Del: spam -- https://master.php.net/note/delete/107106/spam Del: non-english -- https://master.php.net/note/delete/107106/non-english Del: in docs -- https://master.php.net/note/delete/107106/in+docs Del: other reasons-- https://master.php.net/note/delete/107106 Reject -- https://master.php.net/note/reject/107106 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185451) next »