note 116609 deleted from function.system by cmb

From: Date: Sun, 28 Jul 2019 08:21:03 +0000
Subject: note 116609 deleted from function.system by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211743@lists.php.net to get a copy of this message
Note Submitter: Tom Kaminski ---- Seems like php doesn't recognize the -e command line switch for system command "echo": <?php system('echo -e hello'); ?> returns "-e hello", but you'd expect "hello". Odd thing is that you don't need to specify -e as it by default enables the interpretation of backslash escapes: <?php system('echo \'hello\nthere\' '); ?> returns: hello there but running the same command from the bash shell: # echo 'hello\nthere' returns: hello\nthere My guess is that php does some special checks to see if echo is being executed by the system and automatically adds the -e switch.

« previous php.notes (#211743) next »