štvrtok 9. decembra 2010

PHP - how to print response, close communication and continue by some function

After long search i found this and its works! :)

        ob_end_clean();
        //set header
        header("content-type: text/xml");
        header("Connection: close\r\n");
        ob_start();
        //print response
        $sMessage = '<?xml version="1.0" encoding="UTF-8"?>';
        $sMessage.= '<message><id>1</id></message>';
        echo $sMessage;     
        $iSize = ob_get_length();
        header("Content-Length: $iSize");
        ob_end_flush();
        flush();
        ob_end_clean();
       
        sleep(10);
        //call some function or method
        callMyFuncion();
       
      

Žiadne komentáre:

Zverejnenie komentára