문자열 쉘 명령어 관련 문자에 따옴표 붙이고 반환 - string escapeshellarg ( string $arg )
2014. 1. 12. 19:50
- <?php
- $arg = $command = "ls -l | grep txt";
- echo escapeshellarg($arg);
- // 'ls -l | grep txt'
- ?>
--------------------------------------------------------------------------------------------
string escapeshellarg ( string $arg )
4. 라인
$arg문자열에 쉘 명령어를 받을때
명령어로 조작하지 못하게 따옴표를 붙이고 문자열을 반환합니다.
비슷한 함수로는 escapeshellcmd()함수가 있습니다.