<?xml version="1.0" eccoding="utf-8"?>
<phplamp> 
<post> 
      <title id="1">php dfs fd </title> 
      <details> 详细内容 </details> 
</post> 
<post> 
      <title id="2">php dfs fd </title> 
      <details> 详细内容2 </details> 
</post> 
</phplamp> 第一行多个]
另外,请确定你的中文是utf-8

解决方案 »

  1.   

    PHP 中的 SimpleXML 处理
      

  2.   

    me.xml 已改为:<?xml version="1.0" encoding="utf-8"?>
    <phplamp>
    <post>
          <title id="1">php dfs fd </title>
          <details> 详细内容</details>
    </post>
    <post>
          <title id="2">php dfs fd </title>
          <details> 详细内容2</details>
    </post>
    </phplamp>在调试时能显示:
    X-Powered-By: PHP/5.2.5
    Set-Cookie: ZendDebuggerCookie=127.0.0.1%3A10137%3A0||084|77742D65|1019; path=/
    Content-type: text/htmlstartId: 1<br />Title: php dfs fd <br />Details:  详细内容<br /><br />Id: 2<br />Title: php dfs fd <br />Details:  详细内容2<br /><br />end但在页面上知西显示:start
      

  3.   

    发现$xml->load("me.xml");  之前的echo 都能显示,但之后的都不显示?
      

  4.   

    我的php版本是5.1.6,在zendstudio 6.0.1下,调试Debugger location 选php executable?还是 php web server?
      

  5.   


    <?
    $doc = new DOMDocument; //xml开始解析
    $doc->load("me.xml"); 
    $post = $doc->getElementsByTagName( "post");
    echo $post->length;
    foreach($post as $a){  
        // 获取Title标签Node  
        $title = $a->getElementsByTagName("title")->item(0)->nodeValue;  
    $details = $a->getElementsByTagName("details")->item(0)->nodeValue;
       echo iconv("UTF-8","GB2312",$details);}?>
    解析出来了啊
      

  6.   

    找到原因了:文件没有读取的权限。(但debug能读?),谢谢大家。