Example 1 — Show the Server System Type
Log in and print the type of system the FTP server reports.
<?php
$ftp = ftp_connect('ftp.example.com');
ftp_login($ftp, 'demo', 'secret');
echo "Server type: ", ftp_systype($ftp), PHP_EOL;
ftp_close($ftp); How It Works
- The connection is opened and you log in.
- ftp_systype() sends the SYST command to the server.
- The server replies with its system type, here UNIX.
- echo prints the answer on the screen.

