RobertP Posted November 2, 2011 Share Posted November 2, 2011 so does this function help, or can i just use [\n] without worries on windows systems? function getCrlf(){ return strpos('WIN',PHP_OS) ? "\r\n" : "\n"; } Quote Link to comment https://forums.phpfreaks.com/topic/250331-php-crlf/ Share on other sites More sharing options...
gizmola Posted November 2, 2011 Share Posted November 2, 2011 PHP already has a constant to take care of this since version 5.02: PHP_EOL See http://us2.php.net/manual/en/reserved.constants.php for more of these. Quote Link to comment https://forums.phpfreaks.com/topic/250331-php-crlf/#findComment-1284440 Share on other sites More sharing options...
RobertP Posted November 2, 2011 Author Share Posted November 2, 2011 sweet, 1 more question ... is there a way to check a folders permissions using php? i set the permission with htaccess, but i want to make sure the access is correct. Quote Link to comment https://forums.phpfreaks.com/topic/250331-php-crlf/#findComment-1284442 Share on other sites More sharing options...
gizmola Posted November 3, 2011 Share Posted November 3, 2011 sweet, 1 more question ... is there a way to check a folders permissions using php? i set the permission with htaccess, but i want to make sure the access is correct. You can check the permissions -- no problem there. I don't follow your htaccess comment though. An htaccess doesn't set permissions, it simply defines apache/php settings (if apache has been configured to allow this) for a particular directory. The file system permissions are independent of an htaccess file. With that said, php has the function fileperms that will get you the perms on a file or directory. I don't use php on windows, so I can't speak from experience in terms of how compatible it is with windows OS's as the permissions schemes are very different. Quote Link to comment https://forums.phpfreaks.com/topic/250331-php-crlf/#findComment-1284448 Share on other sites More sharing options...
SparK_BR Posted November 4, 2011 Share Posted November 4, 2011 I don't use php on windows, so I can't speak from experience in terms of how compatible it is with windows OS's as the permissions schemes are very different. if you use cygwin or something and do a "ls -lia" you will see that things that can be run are marked with x, things that are readonly aren't marked with w and so on I think ntfs uses the chmod policy but windows explorer hides it from the user except if you try to share the folder, then you will see the permition settings oh btw, to set a folder and/or file permition use chmod bool chmod ( string $filename , int $mode ) Quote Link to comment https://forums.phpfreaks.com/topic/250331-php-crlf/#findComment-1284853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.