note 88129 deleted from function.escapeshellarg by thiago
| From: | thiago@php.net | Date: | Mon, 12 Jan 2009 12:57:36 +0000 |
| Subject: | note 88129 deleted from function.escapeshellarg by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149091@lists.php.net to get a copy of this message | ||
Note Submitter: Aruna Lakmal
----
I want to execute a php script in command line. I'm passing three arguments to the php script.
Arguments contains strings with new lines(\n), carrage returns(\r). But when i parsing arguments
through the escapeshellarg script don't get the whole argument list.
arguments:
$args =" Dear friend,\nabcd'\nefg, - \n[Solution by Aruna]";
command:
exec ( "php myscript.php escapeshellarg ($msg), &$out );
print_r($out );
Output:
[0] =>
[1] => Array
[2] => (
[3] => [0] => Dear friend,abcd'
[4] => )
As you can see after new line some contents missing in the arguments to the myscript.php file.
Any ideas?