Is it possible to specify a directory over FTP in PHP?

Yes, it is possible to specify a directory over FTP in PHP by using the ftp_chdir() function. This function allows you to change the current directory on the FTP server to the specified directory.

// Connect to FTP server
$ftp_server = 'ftp.example.com';
$ftp_user = 'username';
$ftp_pass = 'password';
$conn_id = ftp_connect($ftp_server);
ftp_login($conn_id, $ftp_user, $ftp_pass);

// Change directory
$directory = '/path/to/directory';
ftp_chdir($conn_id, $directory);

// Close FTP connection
ftp_close($conn_id);