I use this to create and write a file:
$file= fopen("city.txt" , "w");
fwrite($file, $content); //fwrite -- Binary-safe file write
fclose($file);
but I got warning and the file is not created:
Warning: fopen(ec_cityid.txt) [function.fopen]: failed to open stream: Permission denied in /usr/local/www/.........php on line 6
Can someone help me on this? Thanks.