I have a form where a user can input contents, which I will then save in a MySQL table, and also make a Linux filename from. I'm looking to escape the user input in PHP for security reasons and also to create valid Linux filenames, but I'm not sure exactly how to do this.
Can PHP's urlencode() function be used to escape arbitrary input for use in Linux filenames? Is there anything urlencode() will not encode, that may cause problems with Linux's file system? Or, is there maybe a more preferable or more industry standard way to escape strings for use in Linux filenames?