As previously answered, the PHP manual is a good place to look, but the FTP functions won't be much help. Look at the Secure Shell (SSH) functions and you will find direct support for SFTP.
You will need:
OpenSSL
libssh2
ssh2.so (PHP extension).
The attached source reference link provides detailed information and a list of any functions you will need to get SFTP up and running. (For non-interactive sessions, consider scp; it's easier to script and usually supported at any site offering SFTP services).
Added:
If you cannot use a php extension for some reason, you might consider using the sftp (or scp) client from openssh, called using the PHP system() function.
But sftp is interactive, so scripting responses becomes a problem here (read from file, perhaps? Or use the expect library?) Use scp with keys, if you can, to avoid the interactive problem.
If you resort to using "system()", be sure to clean any user-supplied data used in the parameter list; it MUST be cleansed! In general, this should be a last resort due to the security implications.