undefinedfix
Sign in

How to translate curl command into PHP curl representation

Pamela edited in Thu, 30 Jun 2022
curl -p --insecure "ftp://127.0.0.1:21111" --user "test:test" -Q "-RNFR /home/text.txt" -Q "-RNTO /data/text.txt"

This curl command, how to use PHP curl method to write it

2 Replies
openHBP
commented on Thu, 30 Jun 2022

It's not solved. It's executed by shell

jlavallet
commented on Thu, 30 Jun 2022

$ ch = curl_ init (); curl_ setopt ($ ch , CURLOPT_ URL , $ url ); curl_ setopt ($ ch , CURLOPT_ HEADER , TRUE ); curl_ setopt ($ ch , CURLOPT_ NOBODY , TRUE ); // remove body curl_ setopt ($ ch , CURLOPT_ RETURNTRANSFER , TRUE ); $ head = curl_ exec ($ ch ); $ httpCode = curl_ getinfo ($ ch , CURLINFO_ HTTP_ CODE ); curl_ close ($ ch );

lock This question has been locked and the reply function has been disabled.