草庐IT

encoder-decoder

全部标签

php - SOAP 错误 : Encoding: Violation of encoding rules?

我正在尝试使用Yii来提供网络服务。自动生成的wsdl如下。我可以从命令行成功使用Web服务,但是通过Web浏览器,我得到了SOAP-ERROR:Encoding:Violationofencodingrules我是SOAP的新手,所以我不确定如何调试问题。这是我用来使用Web服务的PHP代码:1,'exceptions'=>1));try{$result=$client->getPerson(90043412);var_dump($result);}catch(SoapFault$fault){echo$fault->getMessage().'';echo'REQUEST';ech

php - PHP 中的 DOM : Decoded entities and setting nodeValue

我想使用PHP使用DOM对XML文档执行某些操作它的标准库的一部分。正如其他人已经discovered,然后必须处理解码的实体。为了说明困扰我的问题,我举了一个简单的例子。假设我们有如下代码$doc=newDOMDocument();$doc->loadXML();$xpath=newDOMXPath($doc);$node_list=$xpath->query();foreach($node_listas$node){//dosomething}如果循环中的代码是这样的$attr="";$val=$node->getAttribute($attr);//dosomethingwith

PHP : file_get_contents with json_decode not working together

我在使用file_get_contents读取json文件后遇到问题。当我运行这段代码时,它工作正常:结果:沙查尔加诺当我运行这段代码时,它是空的:结果:****空——没有出现****当我运行这段代码时,检查file_get_contents是否正常工作:结果:[{"fullName":"ShacharGanot","address":"YadRambam","phoneNumber":"050-1231233","email":"","note":"","role":"","area":""},{"fullName":"BettyGanot","address":"Modiin","

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 - PHP 中的 json_encode() 返回转义 Unicode 中的汉字

我有一个简单的PHP一维数组。当我执行vardump(echovar_dump($a))时,我将其作为输出:array(3){[0]=>string(3)"尽"[1]=>string(21)"exhausted||toexhaust"[2]=>string(4)"jin3"}但是,当我对它进行json_encode(echojson_encode($a))时,我得到了这个:["\u5c3d","exhausted||toexhaust","jin3"]它返回的十六进制值是正确的,但我不知道如何阻止它给我十六进制值。我只是想让它显示角色。如果我echomb_internal_encodi

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;}这

c# - 从基于 JSON/PHP (base64_encode) 的图像中解释 C# 中的 base 64

所以我能够成功读取图像文件,并将其传回我的C#应用程序,但我无法正确解码它。我正在通过PHP返回JSON数据(未显示json_encode函数):$imgbinary=fread(fopen($filename,"r"),filesize($filename));if(strlen($imgbinary)>0){returnarray("success"=>true,"map"=>base64_encode($imgbinary));}然后在C#中,我使用Newtonsoft.Json解码字符串(我可以成功读取和map属性),但我无法使用base64解码将图像正确写入文件(或显示).我

php - json_encode bool 返回错误值

我正在编写一个jquery登录。如果php登录脚本(checklogin.php)回显“true”,那么我的jquery页面应该发出警报。当我运行login.php(不使用jquery)时,它会将请求发送到checklogin.php,回显“true”,但是如果我使用我的jquery登录脚本将登录信息发送到checklogin.php,我跟踪的警报后面说“假”。$('#login').click(function(e){$.getJSON("http://www.hedonsoft.com/game/login.php",{username:$("#username").val(),p

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 - 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