PHP에서 Python을 호출한 후, 리턴값 받기
2014.07.11 23:08
In PHP, you can execute a command and obtain the return code using exec
.
The manual for exec
says the third parameter is a variable in which the return code will be stored, for example
$exec('python blibble.py',$output,$ret_code);
$ret_code will be the shell return code, and $output is an array of the lines of text printed to std. output.
This does appear to be an appropriate use for a return code from what you described, i.e. 0 indicating success, and >0 being codes for various types of errors.
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.