정보실

웹학교

정보실

php PHP에서 exec 함수

본문

$file = $_POST['filename'];//A file which is upload by user

$piece  = explode(".",$file);//Extract the extension part of file.
$length = sizeof($piece);
//We can use this code for another language changing only in compiler
if($piece[$length-1]==="c")
{
    exec("gcc $file -o output");
    exec("./output < arguments", $out);//Arguments which is useful in program and make $out
    for ($i=0; $i ($out);>

페이지 정보

조회 132회 ]  작성일18-06-10 10:08
php

웹학교