Change language

PHP ftp_pwd () function

Syntax:
string ftp_pwd ($ftp_conn)
Parameter:this function takes one parameter $ftp_conn, which is used to specify the FTP connection to use.Return Value:returns the name of the current directory on success, or False on errors.NOTE.This feature is available in PHP 4.0.0 and later.Example 1:
// PHP connection and login program
// to the FTP server 
// Initialize the ftp server address $ftp_server = "ftp.example.com" ;
$ftp_conn = ftp_connect ( $ftp_server ) or die ( "Could not connect to $ftp_server" );  
// Initialize ftp username $ftp_username = "johndoe" ;  
// Initialize ftp password $ftp_userpass = "john # 96" ; $login = ftp_login ( $ftp_conn , $ftp_username , $ftp_userpass );  
// Change the current directory to php ftp_chdir ( $ftp_conn , " php " );  
// Print the name of the current directory (/ php) echo ftp_pwd ( $ftp_conn );  
// Close connection ftp_close ( $ftp_conn );  
?>
Output:
/ php
Note:This code cannot be run in multiple online development environments as it does not grant permission for FTP connections. If it supports, use the ftp server work url, username, password and in addition it displays the directory name.Example 2:
// PHP connection and login program
// to the FTP server 
// Initializing the ftp server address $ftp_server = "ftp.example.com" ;  
// Establish a basic connection $conn_id = ftp_connect ( $ftp_server );  
// Initialize ftp username $ftp_user_name = "johndoe" ;  
// Initialize ftp password $ftp_user_pass = "john # 96" ;  
// Login with username and password $login_result = ftp_login ( $conn_id , $ftp_user_name , $ftp_user_pass );  
// Change directory to public_html ftp_chdir ( $conn_id , ’ public_html’ );  
// Print the current directory / public_html echo ftp_pwd ( $conn_id );  
// Close connection ftp_close ( $conn_id );  
?>
Output:
/ public_html
Link: http: // php.net/manual/en/function.ftp-pwd.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method