Ravi Prakash
Ravi Prakash

Reputation: 33

How to pass @ as a ftp password in php

I have to use @ in a password string for ftp

$file = "ftp://username:[email protected]/public_html/filename";

when i use password 'xyz@!@#' it does not work because @ is used by ftp as a separator. But many user use special character specially @.

Pls help me out.

Upvotes: 0

Views: 382

Answers (1)

user2148742
user2148742

Reputation: 11

Consider using UrlEncoding. I think the encoder for "@" is "%40" (without the double-quotes)

Upvotes: 1

Related Questions