我有接觸外部API不添加斜線
$arr = array(
"domain_name" => $_POST["domain"],
"auto_renew" => false,
"domain_lock" => false,
"whois_privacy" => false,
"contact_registrant_id" => $_POST["registrant_contact"],
"contact_admin_id" => $_POST["admin_contact"],
"contact_tech_id" => $_POST["tech_contact"],
"contact_billing_id" => $_POST["billing_contact"],
"auth_code" =>($_POST["auth_code"])
);
我張貼的$_POST["auth_code"]
值是l&"IkM%Wbjjq7
然而,當它張貼此值,它被張貼了這個PHP代碼PHP後值as l&\\\"IkM%Wbjjq7
因此,它添加斜線,這是造成問題。
你試過addslashes()嗎? –
爲什麼我'addslashes'當我不要他們 – charlie
檢查此鏈接http://stackoverflow.com/questions/6339145/how-to-remove-multiple-slashes-in-uri-with-preg-or-htaccess –