草庐IT

decode_apk_dir

全部标签

php - 无法进行 json_decode

我正在将数据从Vb.net客户端发布到PHPrestapi,但由于某种原因,json_decode无法处理传递的字符串。发布到服务器的代码是:DimpayloadAsString="{""key"":""Test"",""bookings"":"&txtUpload.Text&"}"DimrequestAsWebRequest=WebRequest.Create(String.Format(baseAPIImportUrl))'SettheMethodpropertyoftherequesttoPOST.request.Method="POST"'CreatePOSTdataandco

php - Json_Decode 不解码我的 JSON

我正在使用couchDB获取UUID,以便我可以将新文档发送到数据库。为了得到这个UUID,我使用了一个curl语句:functiongetUUID(){$myCurlSubmit=curl_init();curl_setopt($myCurlSubmit,CURLOPT_URL,'http://localhost:5984/_uuids');curl_setopt($myCurlSubmit,CURLOPT_HEADER,0);$response=curl_exec($myCurlSubmit);curl_close($myCurlSubmit);return$response;}这

php - json_decode 为 WordPress 中的 POST 数据返回 "NULL"

我尝试像这样JSON.stringify一个数组到服务器:JavaScript:jQuery.ajax({type:'post',url:ajax_url,data:{'settings':JSON.stringify([...]),'action':[...]},traditional:true,success:function(data){alert("SUCCESS");},error:function(errorThrown){console.log(errorThrown);}});但是当我在PHP中尝试json_encode时,它返回NULL。PHP$param=json_

php - Zend Framework : Could not determine temp directory, 请手动指定一个 cache_dir

我正在学习Zend框架。我创建了一个简单的Zend_Form,当我提交表单时出现以下错误:AnerroroccurredApplicationerrorExceptioninformation:Message:Couldnotdeterminetempdirectory,pleasespecifyacache_dirmanuallyStacktrace:-0H:\Documents\IIS_Server_Root\zendframework\Zend\Cache\Backend.php(197):Zend_Cache::throwException('Couldnotdeter...'

php - html_entity_decode - 字符编码问题

我在字符编码方面遇到问题。我已将其简化为以下脚本:';//Stan'sechohtml_entity_decode($string).'';//Stan'sechohtml_entity_decode($string,ENT_QUOTES,'UTF-8');//Stans?>我想利用最后一个echo。但是,它删除了',为什么?更新我已经尝试了所有三个选项ENT_COMPAT、ENT_QUOTES、ENT_NOQUOTES,它在所有情况下都删除了'. 最佳答案 问题是’解码为Unicode字符U+0092,UTF-8C292

php - 在 php 中从 json_decode() 获取值时出错?

我有一个示例代码:$description='{"2GNetwork":"GSM850/900/1800/1900","3GNetwork":"HSDPA850/900/1700/1900/2100"}';$data=json_decode($description);echo$data->2GNetwork;//ORecho$data['2GNetwork'];结果出错,如何解决! 最佳答案 试试这个:echo$data->{'2GNetwork'};问题不在于JSON,而是您尝试访问的对象属性中有一个空格。如果你使用花括号{},

php - jQuery 和 PHP : Encode & Decode URL

每当单击链接时,我都会通过URL将字符串传递到另一个页面。原始的a标签及其href是通过PHPwhile循环创建的,如下所示:注意:a标记确实包含其他属性,但为简单起见我删除了它们。然后使用以下jQuery函数将当前窗口尺寸附加到href:$("a[href^='secondary_imgs.php']").click(function(){varpageWidth=$(window).width();varpageHeight=$(window).height();varurl=$(this).attr('href');varidx=url.indexOf('&pageWidth='

PHP json_decode 不工作

好吧,那么,我有一个游戏可以将JSON格式的数据上传到我的站点。JSON类似于:{"PlayerList":[{"PlayerKills":0,"Username":"Player1","TimePlayed":0,"Deaths":0},{"PlayerKills":0,"Username":"Player1","TimePlayed":0,"Deaths":0}]}在确认JSON确实是正确的,没有错误之后,我开始猜测是PHP的问题。我用来获取JSON的代码是:$decodedJSON=json_decode($entityBody,true,4);var_dump($decoded

php - 执行 html_entity_decode 后出现奇怪的字符 (�)

在一个单独的YML文件中,我有:flags:[]当我将它调用到我的代码中时,它没有被解释,所以我使用了html_entity_decode.它有效,但我只有1个奇怪的字符在我的图像之前:�render());?>我的所有文件都是UTF8编码的。你知道我错过了什么来解决这个问题吗?附言:publicstaticfunctiongetI18nCulturesForChoice(){returnarray_combine(self::getI18nCultures(),self::getI18nCulturesFlags());} 最佳答案

php - Json_encode、json_decode 和 UTF8

全部,我使用PHP向Web服务器发出JSON请求,它在一个变量中返回给我一个JSON响应。JSON响应将包含许多键和值。我从服务器获得的JSON响应中有特殊字符。因此,我使用以下语句将其转换为UTF8,解码JSON并将其用作数组以显示给UI。$response=json_decode(utf8_encode($jsonresponse));现在,我必须在JSON请求中将相同的值传递给服务器以执行一些操作。然而,当我通过$jsonrequest=json_encode(utf8_encode($request));到服务器,它失败了。以下代码成功读取特殊字符并将其显示到UI。但是,如果我