0

I have created a folder and named it "↓" (using Alt+25). My operating System is Windows XP service pack 3. Now, I want to write a file in it with filename rpa.txt

<?php
$file='C:\Documents and Settings\Owner\Desktop\↓\rpa.txt';
fopen($file,'w');
?>    

Problem is: after this code is executed, the file rpa.txt should be created automatically in the folder named '↓', but that doesn't happen.

Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80
  • 1
    Do you receive any kind of error message? – Bjoern Apr 06 '13 at 11:58
  • print the output of file_exists('C:\Documents and Settings\Owner\Desktop\↓\'); I am pretty sure that PHP is having difficulties reading ↓ character in the name... – Jay Bhatt Apr 06 '13 at 12:03
  • @Bjoern NO! the file should be created after the code execution :( . No error messages!! I'm facing this problem only when i use special charecters like ↓ ,¢ etc. for my folder name. – user2252098 Apr 06 '13 at 12:03
  • 3
    What codepage is your Windows filesystem; what charset are you using for your PHP script? Do they match? This is a good reason to only use ASCII characters in file and directory names – Mark Baker Apr 06 '13 at 12:05
  • [Look here](http://stackoverflow.com/a/10008491/1216680) – Houari Apr 06 '13 at 12:28
  • Well.. I just found out that (alt+25) is one of the ASCII CONTROL CHARECTERS. Using 'ASCII CONTROL CHARECTERS' or 'EXTENED ASCII CHARECTERS' for folder name are resulting in failure of creating the file "rpa.txt" in that particular folder. The file "rpa.txt" is created only if we use ASCII PRINTABLE CHARECTERS for folder name (excluding \/:*?"<>|). – user2252098 Apr 06 '13 at 13:08

0 Answers0