Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8298837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:55:49+00:00 2026-06-08T15:55:49+00:00

I am writing php code which will work under *nix systems. I need to

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:55:51+00:00Added an answer on June 8, 2026 at 3:55 pm

    The function you want is escapeshellcmd():

    $arg1 = escapeshellarg($input1);
    $arg2 = "foo";
    $arg3 = escapeshellarg($input3);
    $arg4 = "bar";
    $arg5 = escapeshellarg("a string containing spaces and other *special* characters");
    $proc = proc_open("python_prog $arg1 $arg2 $arg3 $arg4 $arg5", ...);
    

    In the other thread, the program didn’t take any arguments, the newlines were being used to separate items on standard input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a php script that will fetch data from a given URL and
I am writing a module, let's call it base , which will show a
I'm writing a php code which is meant to run from the Unix console,
I am writing a web application in PHP which will store employee data and
When writing PHP code for any given project, do you find you can write
I'm writing a php code where the user enter various details and then submits
I am writing a PHP code that creates another PHP file with fopen and
Initially I had the habbit of directly writing the php code in the <?php
I have this code in PHP writing views to a text-file and just increasing
I'm writing code in PHP that requires including a config.php file depending on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.