I am calling a C++ program via PHP, using the system() function:
$use = '"' . $_POST['source'] . '"';
system("Subject " . $use);
where $use stores some text that might contain line breaks and that gets itself passed to the PHP program using the $_POST variable. If I pass this variable to the C++ program and the contained text has line breaks, then only the first line gets passed to the program. I tried to avoid this by using the two quotation marks, but this doesn't work. So if the input is for example
word 1
word 2
then only word 1 is passed to the C++ program. Conversely, if the input is of the form
word 1 word 2
then of course everything works fine.
How can I solve this if there is a solution at all?