ホームページ php教程 php手册 PHP での XML アプリケーション開発の基本 ノードの追加 ノードの削除 ノードのクエリ セクションのクエリ

PHP での XML アプリケーション開発の基本 ノードの追加 ノードの削除 ノードのクエリ セクションのクエリ

Jun 13, 2016 pm 12:15 PM
php xml 1つ 消去 スケーラブル ベース アプリ 開発する お問い合わせ マーク に追加 導入 ノード

1. XML の概要

XML (Extensible Markup Language) は、主に Web アプリケーションとサーバー間の簡単な対話、データの保存、使用に使用されます。

XML 標準を使用してエンコードされたデータは、人間やコンピューターが簡単に解釈できる意味と構造を持っています。 XML データはプラットフォームやアプリケーションに依存しません。言うまでもなく、このこと自体が XML をインターネットにとって理想的なデータ交換形式にしています (実際、XML はまさにこの目的のために開発されました)。最近、ブロードバンド接続の成長と、あらゆる媒体でデータを共有するアプリケーションに対する消費者の需要により、XML Web サービスとアプリケーションがますますリッチになってきています。

XML は、インターネット上の豊富なデータを記述するという組織的な問題を解決するために発明されました。これまでのところ、この問題は HTML を賢く使用することで部分的にしか解決できません。

以下は XML ドキュメントの例です:
プログラム コード

コードをコピー コードは次のとおりです:



私の家

<ゲスト>ジョン・ブログ
<アイテム>フォスターズ
<アイテム>傘< /item>
Bombay Mix



HTML のように見えると仮定できます。 HTML は SGML アプリケーションであり、XML はそのサブセットです。ただし、類似点には、類似したラベル区切り文字があることも含まれます。

上記の XML フラグメントを見るだけで、データが多数のゲストを含むパーティーを記述しており、各ゲストが項目に対応していることがわかります。データを説明するために使用されるラベル名はすべて作成者によって選択されます。すべての XML 標準では、データに一貫性があり、データの記述に使用されるタグが適切な形式である必要があります。文書型宣言 (DTD) または XML スキーマを使用して、データの整合性をさらに強化できます。ただし、簡単にするために、この記事ではプレーン XML のみを使用します。


2. XML アプリケーション

これまで、XML を使用してあらゆる種類のデータを記述する方法を見てきました。実際、XML は現在、多くの Web アプリケーションで広く使用されています。以下に有名なアプリケーションの説明を示します。

・ XHTML - これは最も広く使用されている XML アプリケーションの 1 つです。これは HTML に基づく SGML に似ており、Web ページ上でデータがどのように表示されるかを記述するために使用されます。 XHTML は DTD を使用して、すべてのドキュメントが標準に準拠していることを確認します。 XHTML の登場により、Web プログラマにとって開発は若干容易になりましたが、CSS および XHTML 標準と完全に互換性のある Web ブラウザはまだ登場していません。

· XML-RPC - リモート プロシージャ コール (RPC)。分散アプリケーションでリモート コンピュータ上のプロシージャを呼び出すために使用されます。 XML-RPC は、XML を使用してプロシージャ呼び出しに関する情報をエンコードし、HTTP を使用してそれを受信側コンピューターに送信します。プロシージャの戻り値は XML で再度エンコードされ、HTTP 接続を使用して呼び出し元のコンピュータに送り返されます。
· RSS - Really Simple Syndication/Rich Site Summary。特別なアプリケーションを使用して Web サイトのコンテンツ (ニュース、記事、株価、リンクなど) を集約するために使用される方法です。アグリゲータ)は、ユーザーの PC 上の RSS フィードを定期的に更新します。この RSS データは XML を使用してエンコードされて送信されます。
・AJAX - Web 開発者が Web ブラウザーで実行される機能豊富なイベント駆動型 Web アプリケーションを作成できるようにする非同期 JavaScript および XML。このうち JavaScript は、XML エンコードされたデータをサーバー側スクリプトに送信する (またはサーバー側から XML エンコードされたデータを受信する) ために使用され、すべてのページ コンテンツを更新せずに部分的なリアルタイム ページ更新を可能にします。

上記は、XML の可能なアプリケーションのほんの一部です。今後の記事では、これらのアプリケーションを PHP で使用する方法を分析します。


3. PHP での XML の使用


PHP 5.0 以降、PHP が XML と対話するために使用できるオプションが大幅に増加しました。 PHP バージョン 4 が提供できるのは、不安定で w3c と互換性のない DOM XML 拡張機能です。
以下では、XML との対話を可能にする PHP 5 が提供する 3 つのメソッド (DOM、シンプル XML、XPath) に焦点を当てます。可能な場合は、それぞれのアプローチに最適な条件とデータを提案します。すべてのサンプル コードでは、XML データ ソースを使用して、図書館とそこに含まれる書籍を記述します。

プログラムコード

コードをコピー

コードは次のとおりです:




 
  Web Development
  Database Programming
  PHP
  Java
 

 
 
  Apache 2
  Peter Wainwright
  Wrox
  1
 

 
  Advanced PHP Programming
  George Schlossnagle
  Developer Library
  1
  3
 

 
  Visual FoxPro 6 - Programmers Guide
  Eric Stroo
  Microsoft Press
  2
 

 
  Mastering Java 2
  John Zukowski
  Sybex
  4
 





四、 DOM

  DOM PHP扩展名允许使用W3C DOM API在XML文档上进行操作。在PHP 5出现之前,这是PHP能存取XML文档的唯一方法。如果你在JavaScript中使用了DOM,那么会认识到这些对象模型几乎是一样的。

  由于DOM方法在遍历和操作XML文档时比较罗嗦,所以任何DOM兼容的代码都有明显的优点-与任何其它实现相同的W3C兼容的对象模型的API兼容。

  在下面的实例代码中,我们使用DOM来显示关于每本书的信息。首先,我们遍历一下列表目录,把它们的Id和相应的名字装载到一个索引数组中。然后,我们显示每本书的一个简短描述:

  PHP:

复制代码 代码如下:


 /*这里我们必须指定XML版本:也即是1.0 */
 $xml = new DomDocument('1.0');
 $xml->load('xml/library.xml');
 /*首先,创建一个目录列表*/
 $categories = array();
 $XMLCategories = $xml->getElementsByTagName('categories')->item(0);
 foreach($XMLCategories->getElementsByTagName('category') as $categoryNode) {
  /*注意我们是如何得到属性的*/
  $cid = $categoryNode->getAttribute('cid');
  $categories[$cid] = $categoryNode->firstChild->nodeValue;
 }
?>


XML Library


 php foreach($xml->getElementsBytagName('book') as $book):
 /*查找标题*/
 $title = $book->getElementsByTagName('title')->item(0)->firstChild->nodeValue;
 /*查找作者-为了简化起见,我们假设仅仅有一个作者*/
 $author = $book->getElementsByTagName('author')->item(0)->firstChild->nodeValue;
 /* 列表目录*/
 $bookCategories = $book->getElementsByTagName('category');
 $catList = '';
 foreach($bookCategories as $category) {
  $catList .= $categories[$category->firstChild->nodeValue] . ', ';
 }
 $catList = substr($catList, 0, -2); ?>



Author::


Categories: :





[html]
繰り返しますが、XML の変更はさらに面倒です。たとえば、ディレクトリを追加するコードは次のとおりです。

PHP:
[code]
function addCategory(DOMDocument $xml, $catID, $catName) {
$catName = $xml->gt ;createTextNode($catName); //テキストを保存するノードを作成します
$category = $xml->createElement('category') //カタログ要素を作成します
$category-> ;appendChild( $catName); // カタログ要素にテキストを追加します
$category->setAttribute('cid', $catID) // カタログの ID を設定します
$XMLCategories = $xml- >getElementsByTagName( 'categories')->item(0);
$XMLCategories->appendChild($category); // 新しいディレクトリを追加します
}


5. XML の保存

save() メソッドと saveXML() メソッドのいずれかを使用して、DOM 記述を XML 文字列記述に変換し直すことができます。 save() メソッドは XML を指定された名前でファイルに保存し、saveXML() メソッドはドキュメントの一部または全体から文字列を返します。

$xml->save('xml/library.xml');
//すべてのファイルを保存します
$categories=$xml->saveXML($XMLCategories); // カテゴリを含む文字列を返します

DOM 互換コードを別の言語に移植することがいかに簡単かを示すために、上記と同じ関数を JavaScript で実装するコードを次に示します。

Javascript:

コードをコピー コードは次のとおりです:

function doXML(){
/* まず、カテゴリリスト */
var category = Array();
var XMLCategories = xml.getElementsByTagName('categories')[0]
var theCatalog = XMLCategories.getElementsByTagName('category'); for ( var i = 0; i < theCategories.length; i ) {
/* 属性の取得方法に注意してください*/
var cid = theCategories[i].getAttribute('cid'); > カテゴリ[cid] = theCategories[i].firstChild.nodeValue;
}
var theBooks = xml.getElementsByTagName('book');
for(var i = 0; i var book = theBooks[i];
/* タイトルを検索*/
var title = book.getElementsByTagName('title')[0].firstChild.nodeValue; /* 著者を検索します - 簡単にするために、著者は 1 人だけであると仮定します */
var author = book.getElementsByTagName('author')[0].firstChild.nodeValue; /* カテゴリをリストします */
var bookCatalog = book.getElementsByTagName('category');
var catList = '';
for(var j = 0; j < bookCategories.length; j ) {
catList = カテゴリ[bookCategories[ j].firstChild.nodeValue] ', ';
}
catList.substring(0, catList.length -2);
document.open(); write("

" タイトル "

");
document.write("

著者:: " 著者 "

");
Document.write("

カテゴリ: : " catList "

");
}
document.close() ;
}



6. シンプル XML


シンプル XML は非常にシンプルです。これにより、オブジェクトおよび配列のアクセス メソッドを使用して、XML ドキュメントとその要素および属性にアクセスできるようになります。操作は簡単です:


· 要素 - これらは SimpleXMLElement オブジェクトの個別のプロパティとして記述されます。複数の要素がドキュメントまたは要素の子として存在する場合、配列インデックス フラグを使用して各要素にアクセスできます。
$xml->books;//要素「books」を返します
$xml->books->book[0];//books 要素の最初の本を返します

・属性 - 要素の属性は、連想配列のフラグを通じてアクセスおよび設定されます。このとき、各インデックスは属性名に対応します。

$category['cid']; // cid 属性の値を返します

· 要素データ - 要素内に含まれるテキスト データを取得するには、(string を使用する必要があります) ) 明示的に文字列に変換するか、print または echo を使用して出力します。要素に複数のテキスト ノードが含まれる場合、それらは見つかった順に連結されます。

echo ($xml->books->book[0]->title);//最初の本のタイトルを表示

以下は単純な XML を元に変換したものです実例。 XML ファイルをロードするには、simplexml_load_file() 関数を使用します。この関数は、XML ファイルを解析して SimpleXMLElement オブジェクトにロードします。

PHP:



コードをコピー

コードは次のとおりです:


$xml = simplexml_load_file('xml/library.xml');
/* 把一个列表的目录装载到一个数组中*/
$categories = array();
foreach($xml->categories->category as $category) {
 $categories[(string) $category['cid']] = (string) $category;
}
?>


XML Library


books->book as $book):
/* 列举目录*/
$catList = '';
foreach($book->category as $category) {
 $catList .= $categories[((string) $category)] . ', ';
}
$catList = substr($catList, 0, -2); ?>


title) ?>


Author:: author) ?>


Categories: :





7.テキストデータや属性値は単純なXMLを使用して設定できますが、これらのオブジェクトを新規作成することはできません。ただし、SimpleXM は、DomElement オブジェクトと DomElement オブジェクトの間で変換する方法を提供します。これを行うために、addCategory() 関数を変更して、simplexml_import_dom() 関数を使用してカタログを追加し、ドキュメントを単純な XML 形式に変換する方法を示しました。
PHP:


コードをコピー

コードは次のとおりです。

function addCategory(SimpleXMLElement &$sXML, $catID, $catName) { $xml = new DOMDocument; $ xml->loadXML($sXML->asXML());

$catName = $xml->createTextNode($catName); // テキストを格納するノードを作成します。 >$category = $ xml->createElement('category'); // カタログ要素を作成します

$category->appendChild($catName); // カタログ要素にテキストを追加します
$category- >setAttribute(' cid', $catID); // ディレクトリ ID を設定します
$XMLCategories = $xml->getElementsByTagName('categories')->item(0); appendChild($category) ; // 新しいディレクトリを追加します
$sXML = simplexml_import_dom($xml);
return $sXML;


同様に、 SimpleXMLElement オブジェクトの関数を使用して、XML 文字列を取得し、ファイルに保存し直すことができます。


8. xPath


Xpath が「XML ケーキの上のチェリー」であることは疑いの余地がありません。 XPath を使用すると、SQL のようなクエリを使用して、XML ドキュメント内の特定の情報を検索できます。 DOM と SimpleXML にはどちらも XPath のサポートが組み込まれており、SQL と同様に、XML ドキュメントから必要なコンテンツを抽出するために使用できます。


プログラム コード
· //category - ドキュメント内に表示されるすべてのカテゴリを検索します。
· /library/books - library の子として表示されるすべての書籍を検索します
· /library/categories/category[@cid] - library/categories の子として表示されるすべての書籍を検索しますand have 属性は cid のカテゴリです。

· /library/categories/category[@att='2'] - library/categories の子として表示され、値 2 の属性 cid を持つすべてのカテゴリを検索します。

· /library/books/book[title='Apache 2'] - /library/books の子であり、title 要素の値が Apache 2 である book をすべて検索します。

実際、これは xPath の氷山の一角にすぎません。 xPath を使用すると、ドキュメントからほぼすべての情報を抽出するための多数の複雑なクエリを作成できます。 xPath を使用することがいかに簡単で楽しいかを示すために、サンプル コードを再度変更しました。

PHP:



コードをコピー

コードは次のとおりです:


$xml = simplexml_load_file('xml/library.xml'); /title> </ head> </u><body> </span><?php foreach(((array)$xml->xpath("/library/books/book")): </p> /*list Directory*/ <p class="codebody" id="code56099">$catList = ''; <BR>foreach($book->category as $category) { <br>/*この ID のディレクトリを取得*/ <br>$category = $xml- >xpath("/library/categories/category[@cid='$category']"); <br> $catList .= (文字列) ', ' <br>} <br> $catList = substr($catList, 0, -2); <br><div><br><h2><?php echo($book->title) ?> </ h2><br><p><b>:<?php echo($book->author) ?></p> p><b>カテゴリ: </b>: <?php echo($catList) ?></p> <br><?php endforeach; ; <BR></html> <br><br> <br> 9. DOM と XPath<br> <br><br> DOM で XPath クエリを計算するには、DOMXPath オブジェクトを作成する必要があります。次の Evaluate() 関数は DOMElement の配列を返します。 <br><br><br><br>コードをコピー<br><br> コードは次のとおりです。<br><br> </p>$xPath = new DOMXPath($xml); ->evaluate("/library/books/book[title='Apache 2']"); <br><strong> </strong><br> 10. 結論<br> <br><p class="codetitle"> PHP が提供するツールを使用して XML を操作する方法を学びました。この時点で、「準備が整い」、XML アプリケーションを詳しく調べる準備が整いました。次の記事では、AJAX と、それが Google などのサイト開発でどのように使用されるかについて説明します。 <span style="CURSOR: pointer" onclick="doCopy('code47800')"></span></p> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">このウェブサイトの声明</div> <div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780520.html" title="R.E.P.O.誰も聞こえない場合はオーディオを修正する方法" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.誰も聞こえない場合はオーディオを修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796779766.html" title="WWE 2K25:Myriseのすべてのロックを解除する方法" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:Myriseのすべてのロックを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットAIツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>リアルなヌード写真を作成する AI 搭載アプリ</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>写真から衣服を削除するオンライン AI ツール。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>脱衣画像を無料で</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI衣類リムーバー</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>AIヘンタイを無料で生成します。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780520.html" title="R.E.P.O.誰も聞こえない場合はオーディオを修正する方法" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.誰も聞こえない場合はオーディオを修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796779766.html" title="WWE 2K25:Myriseのすべてのロックを解除する方法" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25:Myriseのすべてのロックを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="メモ帳++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_title"> <h3>メモ帳++7.3.1</h3> </a> <p>使いやすく無料のコードエディター</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 中国語版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 中国語版</h3> </a> <p>中国語版、とても使いやすい</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ゼンドスタジオ 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_title"> <h3>ゼンドスタジオ 13.0.1</h3> </a> <p>強力な PHP 統合開発環境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ドリームウィーバー CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_title"> <h3>ドリームウィーバー CS6</h3> </a> <p>ビジュアル Web 開発ツール</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神レベルのコード編集ソフト(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>ホットトピック</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/gmailyxdlrkzn" title="Gmailメールのログイン入り口はどこですか?" class="phpgenera_Details_mainR4_bottom_title">Gmailメールのログイン入り口はどこですか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7445</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/cakephp-tutor" title="CakePHP チュートリアル" class="phpgenera_Details_mainR4_bottom_title">CakePHP チュートリアル</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1371</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/steamdzhmcssmgs" title="Steamのアカウント名の形式は何ですか" class="phpgenera_Details_mainR4_bottom_title">Steamのアカウント名の形式は何ですか</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>76</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/winactivationkeyper" title="Win11 Activation Key Permanent" class="phpgenera_Details_mainR4_bottom_title">Win11 Activation Key Permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>39</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/newyorktimesdailybrief" title="NYTの接続はヒントと回答です" class="phpgenera_Details_mainR4_bottom_title">NYTの接続はヒントと回答です</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>10</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>6</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/faq/zt">もっと見る</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796733273.html" title="Ubuntu および Debian 用の PHP 8.4 インストールおよびアップグレード ガイド" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/080/676a727698393240.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Ubuntu および Debian 用の PHP 8.4 インストールおよびアップグレード ガイド" /> </a> <a href="https://www.php.cn/ja/faq/1796733273.html" title="Ubuntu および Debian 用の PHP 8.4 インストールおよびアップグレード ガイド" class="phphistorical_Version2_mids_title">Ubuntu および Debian 用の PHP 8.4 インストールおよびアップグレード ガイド</a> <span class="Articlelist_txts_time">Dec 24, 2024 pm 04:42 PM</span> <p class="Articlelist_txts_p">PHP 8.4 では、いくつかの新機能、セキュリティの改善、パフォーマンスの改善が行われ、かなりの量の機能の非推奨と削除が行われています。 このガイドでは、Ubuntu、Debian、またはその派生版に PHP 8.4 をインストールする方法、または PHP 8.4 にアップグレードする方法について説明します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796604983.html" title="CakePHP データベースの操作" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/172596033673647.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP データベースの操作" /> </a> <a href="https://www.php.cn/ja/faq/1796604983.html" title="CakePHP データベースの操作" class="phphistorical_Version2_mids_title">CakePHP データベースの操作</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:25 PM</span> <p class="Articlelist_txts_p">CakePHP でデータベースを操作するのは非常に簡単です。この章では、CRUD (作成、読み取り、更新、削除) 操作について理解します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796604998.html" title="CakePHP の日付と時刻" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/172596042710877.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP の日付と時刻" /> </a> <a href="https://www.php.cn/ja/faq/1796604998.html" title="CakePHP の日付と時刻" class="phphistorical_Version2_mids_title">CakePHP の日付と時刻</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:27 PM</span> <p class="Articlelist_txts_p">Cakephp4 で日付と時刻を操作するには、利用可能な FrozenTime クラスを利用します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796604999.html" title="CakePHP ファイルのアップロード" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/172596043255110.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP ファイルのアップロード" /> </a> <a href="https://www.php.cn/ja/faq/1796604999.html" title="CakePHP ファイルのアップロード" class="phphistorical_Version2_mids_title">CakePHP ファイルのアップロード</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:27 PM</span> <p class="Articlelist_txts_p">ファイルのアップロードを行うには、フォーム ヘルパーを使用します。ここではファイルアップロードの例を示します。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796605002.html" title="CakePHP について話し合う" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202409/10/2024091017281739989.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP について話し合う" /> </a> <a href="https://www.php.cn/ja/faq/1796605002.html" title="CakePHP について話し合う" class="phphistorical_Version2_mids_title">CakePHP について話し合う</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:28 PM</span> <p class="Articlelist_txts_p">CakePHP は、PHP 用のオープンソース フレームワークです。これは、アプリケーションの開発、展開、保守をより簡単にすることを目的としています。 CakePHP は、強力かつ理解しやすい MVC のようなアーキテクチャに基づいています。モデル、ビュー、コントローラー</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796604997.html" title="CakePHP バリデータの作成" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/172596041825531.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP バリデータの作成" /> </a> <a href="https://www.php.cn/ja/faq/1796604997.html" title="CakePHP バリデータの作成" class="phphistorical_Version2_mids_title">CakePHP バリデータの作成</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:26 PM</span> <p class="Articlelist_txts_p">Validator は、コントローラーに次の 2 行を追加することで作成できます。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796604990.html" title="CakePHP のロギング" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/172596037751490.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP のロギング" /> </a> <a href="https://www.php.cn/ja/faq/1796604990.html" title="CakePHP のロギング" class="phphistorical_Version2_mids_title">CakePHP のロギング</a> <span class="Articlelist_txts_time">Sep 10, 2024 pm 05:26 PM</span> <p class="Articlelist_txts_p">CakePHP へのログインは非常に簡単な作業です。使用する関数は 1 つだけです。 cronjob などのバックグラウンド プロセスのエラー、例外、ユーザー アクティビティ、ユーザーが実行したアクションをログに記録できます。 CakePHP でのデータのログ記録は簡単です。 log()関数が提供されています</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796728164.html" title="PHP 開発用に Visual Studio Code (VS Code) をセットアップする方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/080/6764e39e44ffe544.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP 開発用に Visual Studio Code (VS Code) をセットアップする方法" /> </a> <a href="https://www.php.cn/ja/faq/1796728164.html" title="PHP 開発用に Visual Studio Code (VS Code) をセットアップする方法" class="phphistorical_Version2_mids_title">PHP 開発用に Visual Studio Code (VS Code) をセットアップする方法</a> <span class="Articlelist_txts_time">Dec 20, 2024 am 11:31 AM</span> <p class="Articlelist_txts_p">Visual Studio Code (VS Code とも呼ばれる) は、すべての主要なオペレーティング システムで利用できる無料のソース コード エディター (統合開発環境 (IDE)) です。 多くのプログラミング言語の拡張機能の大規模なコレクションを備えた VS Code は、</p> </div> </div> <a href="https://www.php.cn/ja/php-tutorials.html" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p> </div> <div class="footermid"> <a href="https://www.php.cn/ja/about/us.html">私たちについて</a> <a href="https://www.php.cn/ja/about/disclaimer.html">免責事項</a> <a href="https://www.php.cn/ja/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744248989"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>