DOMElement->getAttribute()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > DOMElement->getAttribute()の意味・解説 

DOMElement->getAttribute()

(No version information available, might be only in CVS)
DOMElement->getAttribute() — 属性の値を返す

説明

class DOMElement {
string getAttribute ( string name )
} 現在のノードから、名前が name である 属性の値を取得します。

パラメータ

name
属性の名前。

返り値

属性の値、あるいは name に対応する属性が 見つからなかった場合には空の文字列を返します。

参考

DOMElement->hasAttribute()
DOMElement->setAttribute()
DOMElement->removeAttribute()


DomElement->get_attribute()

(No version information available, might be only in CVS)
DomElement->get_attribute() — 与えられた属性の値を返す

説明

class DomElement {
string get_attribute ( string name )
} 現在の要素中の与えられた属性の値を返します。
PHP 4.3 以降、与えられた名前 name を持つ属性がない場合、空文字列が返されます。

パラメータ

name
検索する属性の名前。このパラメータは大文字小文字を区別します。

返り値

属性の名前を文字列として返す、もしくは与えられた名前 name を持つ属性がない場合、空文字列が返されます。

例 529. 属性の値を取得する
<?php

include("example.inc");

if (!$dom = domxml_open_mem($xmlstr)) {
   echo "Error while parsing the document\n";
   exit;
}

// chapter を取得する
$root = $dom->document_element();
echo $root->get_attribute('language'); // en

?>


PHP 5 への移行

DOMElement->getAttribute() を使用してください。

参考

DomElement->get_attribute_node()
DomElement->set_attribute()



このページでは「PHP関数リファレンス」からDOMElement->getAttribute()を検索した結果を表示しています。
Weblioに収録されているすべての辞書からDOMElement->getAttribute()を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDOMElement->getAttribute()を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DOMElement->getAttribute()」の関連用語

DOMElement->getAttribute()のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DOMElement->getAttribute()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2024 by the PHP Documentation Group.

©2024 GRAS Group, Inc.RSS