1

var_dumpは私に与えています:

 object(QueryPath)#2 (7) {
    ["errTypes":"QueryPath":private]=> int(257)
    ["document":protected]=> object(DOMDocument)#3 (34) {
        ["doctype"]=> string(22)"(object value omitted)"
        ["implementation"]=> string(22) "(object value omitted)"
        ["documentElement"]=> string(22) "(object value omitted)"
        ["actualEncoding"]=> string(5) "UTF-8"
        ["encoding"]=> string(5) "UTF-8"
        ["xmlEncoding"]=> string(5) "UTF-8"
        ["standalone"]=> bool(true)
        ["xmlStandalone"]=> bool(true)
        ["version"]=> NULL
        ["xmlVersion"]=> NULL
        ["strictErrorChecking"]=> bool(true)
        ["documentURI"]=> string(26) "http://www.therock.net.nz/"
        ["config"]=> NULL
        ["formatOutput"]=> bool(false)
        ["validateOnParse"]=> bool(false)
        ["resolveExternals"]=> bool(false)
        ["preserveWhiteSpace"]=> bool(true)
        ["recover"]=> bool(false)
        ["substituteEntities"]=> bool(false)
        ["nodeName"]=> string(9) "#document"
        ["nodeValue"]=> NULL
        ["nodeType"]=> int(13)
        ["parentNode"]=> NULL
        ["childNodes"]=> string(22) "(object value omitted)"
        ["firstChild"]=> string(22) "(object value omitted)"
        ["lastChild"]=> string(22) "(object value omitted)"
        ["previousSibling"]=> NULL
        ["attributes"]=> NULL
        ["ownerDocument"]=> NULL
        ["namespaceURI"]=> NULL
        ["prefix"]=> string(0) ""
        ["localName"]=> NULL
        ["baseURI"]=> NULL
        ["textContent"]=> string(48034)
    }
}

どうやって引っ張るの["textContent"]

私の現在のインデックスページは次のとおりです。

$loadRock = $system->get_theRock();

var_dump($loadRock);
4

2 に答える 2

1

$ loadRock-> html();を試してください。または$loadRock->text();

于 2012-08-26T08:39:29.673 に答える
1

textContentDOMDocumentobject のプロパティであり、これはdocumentproperty ですが、このプロパティはprotectedであるため、 を介して取得することはできません$loadRock->document->textContent

のドキュメントを確認する必要があります。プロパティQueryPathにアクセスする方法などがあるかどうかを確認してください。document

于 2012-08-26T08:19:19.950 に答える