Trying to get PHP to send a variable to Node.js, but it changes the variable in my PHP file I have.
exec("node myscript.js --userid=$userid &", $output);
the $userid
in my test is 346236693579300867
.
In my Nodejs file I have:
var argv = require('minimist')(process.argv.slice(2));
discord.sendMessage("Welcome " + "<@" + argv.userid + ">" );
In Node.js userid = 346236693579300860
. It keeps changing the last digit. Even if I do
exec("node myscript.js --userid=346236693579300867 &", $output);
The output is still 346236693579300860
.
What am I doing wrong?
Am new to Node.js and PHP so am still learning.
Cheers