Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
¿Cómo agregar una nueva línea en shell_exec php?

Quiero ejecutar un archivo node.js a través de php. Lo que quiero lograr en PHP es esto

 C:proj> node main.js text="This is some text. >> some more text in next line"

mi guion php

 shell_exec('node C:\proj\main.js text="This is some text. \n some more text in next line"');

Pero en mi archivo main.js, solo obtengo

 text = this is some text.

el resto de la cadena se está eliminando. ¿Alguien podría ayudar por favor?

Cosas que he intentado

  1. \norte
  2. `n
  3. >>
  4. PHP_EOL
  5. ^
  6. ^\n

pero sin suerte!

Espero que mi pregunta sea clara. Por favor, siéntase libre de pedir más detalles.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

shell_exec("node C:\proj\main.js text=\"This is some text.\n>> some more text in next line\"");

será equivalente a su comando de consola

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!