Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 输入字符串替换为'+';带空格_Php_Web Services_Rest_Joomla - Fatal编程技术网

Php 输入字符串替换为'+';带空格

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

我用Google Chrome的高级REST客户端扩展测试我的web服务, 当我在描述输入框中发送值时(例如“这是我的测试”), 在web服务中,它保存在数据库中。但它将字符串保存为“this+is+my+test”。 web服务使用php和joomla

我在web服务中获取post值的代码

$getData = JRequest::get('post');
$description = $getData['description'];

// $description  contains "this+is+my+test"
我要这根绳子原样。
有人能告诉我问题出在哪里吗?

$description=urldecode($getData['description'])


这就行了。

试试
$description=urldecode($getData['description'])添加为答案,所以可以接受。如果您也建议他使用JInput而不是JRequest,那就太好了。JRequest已弃用。