I am writing php code which will work under *nix systems. I need to call a python script with 5 arguments inside php code. Some of arguments are user input so there could be any characters. I cannot figure out how pass arguments to a script. How would I separate arguments?. For example in this question you separate by end of line character, but in my arguments could be anything written by users. How to pass such arguments? any ideas?
EDIT: I have idea of putting escape character in each quotes symbols ' or " before passing arguments, on the other end I will get rid of escape character. Does json encoding do it?