LiquidGib Posted December 21, 2007 Share Posted December 21, 2007 In php, why does the following only print $msg? The second variable $msgg is not printed. $msg = 'This is a hidden message 1234567890'; $msgg = 'This is a hidden message only meant for the person who is reading it 1234567890'; echo shell_exec("echo $msg"); echo shell_exec("echo $msgg"); Quote Link to comment https://forums.phpfreaks.com/topic/82694-simple-string-shell_exec-puzzle/ Share on other sites More sharing options...
PHP_PhREEEk Posted December 21, 2007 Share Posted December 21, 2007 In php, why does the following only print $msg? The second variable $msgg is not printed. $msg = 'This is a hidden message 1234567890'; $msgg = 'This is a hidden message only meant for the person who is reading it 1234567890'; echo shell_exec("echo $msg"); echo shell_exec("echo $msgg"); Remove the smiley face from $msgg and re-run the commands. does it print now? PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/82694-simple-string-shell_exec-puzzle/#findComment-420605 Share on other sites More sharing options...
LiquidGib Posted December 21, 2007 Author Share Posted December 21, 2007 yes, why it no likey smiley face? Quote Link to comment https://forums.phpfreaks.com/topic/82694-simple-string-shell_exec-puzzle/#findComment-420631 Share on other sites More sharing options...
chigley Posted December 21, 2007 Share Posted December 21, 2007 Because Mr. Smiley Face contains a ) which screws it up Quote Link to comment https://forums.phpfreaks.com/topic/82694-simple-string-shell_exec-puzzle/#findComment-420635 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.