Php 输入字符串替换为'+';带空格
我用Google Chrome的高级REST客户端扩展测试我的web服务, 当我在描述输入框中发送值时(例如“这是我的测试”), 在web服务中,它保存在数据库中。但它将字符串保存为“this+is+my+test”。 web服务使用php和joomla 我在web服务中获取post值的代码Php 输入字符串替换为'+';带空格,php,web-services,rest,joomla,Php,Web Services,Rest,Joomla,我用Google Chrome的高级REST客户端扩展测试我的web服务, 当我在描述输入框中发送值时(例如“这是我的测试”), 在web服务中,它保存在数据库中。但它将字符串保存为“this+is+my+test”。 web服务使用php和joomla 我在web服务中获取post值的代码 $getData = JRequest::get('post'); $description = $getData['description']; // $description contains "t
$getData = JRequest::get('post');
$description = $getData['description'];
// $description contains "this+is+my+test"
我要这根绳子原样。
有人能告诉我问题出在哪里吗?
$description=urldecode($getData['description'])代码>
这就行了。试试$description=urldecode($getData['description'])代码>添加为答案,所以可以接受。如果您也建议他使用JInput而不是JRequest,那就太好了。JRequest已弃用。