Example 3 :

This script encodes the file "C:\01 - after decoding\ST.gif". The resulting file "ST.uue" will be saved in the directory "C:\01 - before decoding". This script also defines a Message Callback function which prints the library messages with a level greater or equal than UUMSG_NOTE into the web page.


// We define the message callback function
function msgcallback_function($msg, $level)
   if ($level >= UUMSG_NOTE)
      echo "$msg";

// We Initialize the library

// We indicate the function of treatment for the messages generated by the library
php_uusetmsgcallback ("msgcallback_function");

// We specify the extension of the resulting file
php_uusetoption (UUOPT_ENCEXT, 'uue');

// We specify the save path
php_uusetoption (UUOPT_SAVEPATH, 'C:\01 - before decoding\\');

// We try now to encode the file.
php_uuencodetofile ('C:\02 - after decodage\ST.gif', UU_ENCODED, NULL, 'ST.uue');

// We clean up all the resources.


Piscines en bois