You are essentially issuing this command through the command line by using exec() from PHP. This means that your arguments are separated by a space instead of a comma. So it is treating 'text' as a separate argument instead of being part of the same string. You can set up your VBS to take multiple arguments by adding them in, which should be fairly obvious:
NOT TESTED
Function WriteLineToFile(ntext,ntext2)
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForWriting, True)
f.WriteLine ntext+ntext2
Set f = fso.OpenTextFile("C:\inetpub\test\test.txt", ForReading)
WriteLineToFile = f.ReadAll
End Function
Dim Arg, var1, var1
Set Arg = WScript.Arguments
var1 = Arg(0)
var2 = Arg(1)
WriteLineToFile(var1, var2)
But if you want to pass the entire string as a single argument with the space(s) in them, I'm not sure how to do that.