I have ac compiled code.
I am using
exec('./a.out 2>&1',$out,$ret);in my php script to get return type where I want to know first whether it ran fine or what went wrong a segmentation fault or infinite loop or something like that.
PHP puts the exit status of the exec()ed program to the $ret
variable. The program has exited successfully iff $ret
becomes 0 after exec() returns.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.