I want to execute a node.js file via php. The thing that I want to achieve in PHP is this
C:proj> node main.js text="This is some text.
>> some more text in next line"
My php script
shell_exec('node C:\proj\main.js text="This is some text. \n some more text in next line"');
But in my main.js file, I'm only getting
text = this is some text.
rest of the string is getting removed. Could anyone help please?
Things I've tried
but no luck!
I hope my question is clear. Please feel free to ask for more details.
shell_exec("node C:\proj\main.js text=\"This is some text.\n>> some more text in next line\"");
将相当于您的控制台命令
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.