ホームページ バックエンド開発 PHPチュートリアル エベレスト究極版 PHP6準備講座 JSONサンプルコード

エベレスト究極版 PHP6準備講座 JSONサンプルコード

Jul 29, 2016 am 08:38 AM

JavaScript プログラミング言語、標準 ECMA-262 第 3 版 - 1999 年 12 月に基づいたサブセットです
JSON は主に、各オブジェクト (オブジェクト) をラップするために {} のペアを使用し、各配列 (配列) をラップするために [] のペアを使用します。 "" のペアで各文字列をラップし、コンマを使用して変数を区切ります。データ型には文字列、数値、配列、オブジェクトが含まれます
次の単純な JSON 形式は、メンバー変数を持つオブジェクト json を記述します。このメンバー変数には 3 つのオブジェクトが含まれます
内容をクリップボードコードにコピーします:
var json = {
'query' : [
{'id':'1','type':'a',' title':'PHP 5.2.0 の新機能 JSON デコーダ &エンコーダ'},
{'id':'2','type':'b','title':'JSON フルネーム JavaScript オブジェクト表記'},
{'array': ['A', 'B' ,'C', 'D', 'E']}
]
}; このようにして、json というオブジェクトを取得できます。この json オブジェクトには、独立したメンバーのクエリ
が含まれており、クエリには配列が含まれています。最初の 2 つのオブジェクトには 3 つのメンバー
が含まれており、最後の Object 配列には配列が含まれています。この説明も明確です。
でもどうやって使うの?
とても簡単です
alert('+json.query.length + ' object.');
//alert 3 つのオブジェクトがあります
alert('type='+json.query[1].type+' rntitle '+json.query[1].title);
//alert type=b title=JSON フルネーム JavaScript オブジェクト表記
alert('arrayindex 3='+json.query[2].array[3]) ;
//アラート配列インデックス 3=D
これにより、複雑な DOM を扱う必要がなく、簡単に必要なデータを取得できます
例えば、上記の例 json.query[ i ]。タイトルはこの方法で取得できます。 i 番目のタイトルに含まれる値
PHP は非常に急速に開発されており、プログラミング コミュニティがまだ JSON についての知識がほとんどない、または JSON が何であるかまったくわかっていないとき
PHP はコアに組み込まれています。最新バージョン 5.2.0 では、デフォルトの状態になっています。はい、他のスクリプト言語と比較して、PHP は先頭に立って、バージョン 5.2.0 で JSON 用の 2 つの関数 json_decode() と json_encode() を実装しました。
前者はJSON形式の文字列をPHPネイティブ配列に復元します
後者はPHPのネイティブ配列をJSON形式の文字列にコンパイルします
ただし、JavaScriptはUnicodeをサポートしているため、データベースにアクセスするときに中国語、日本語などの非Ascii文字を使用すると、韓国語と韓国語の場合は、文字を変更する必要があります。エンコーディングを UTF8 に変換しないと、json_encode() 以降の文字列が文字化けします
======================== ========== = =======================
前の記事でJOSNについて簡単に紹介した後
この記事では実装しますJOSN の使用方法
以下の例では、バージョン 1 以降の使用が必要です
コーディング プロセス全体で utf8 を使用します
テーブルには、id、type、title の 3 つのフィールドがあります
データテーブルの仕様は以下の通りです
内容をクリップボードコードにコピーします:
CREATE TABLE `news` (
` id` int(10) unsigned NOT NULL auto_increment,
`type` varchar(255) NOT NULL default '' ,
`title` varchar(64) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE =MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
コンテンツをクリップボード コードにコピーします:
/ /接続を確立します
$conn = mysqli_connect("localhost", 'root', '')or die( 'データベースに接続できません')
//データベースを選択します
mysqli_select_db($conn,'mydata'); die('データベースを選択できません');
//Google Find の使い方がわかりません
mysqli_query($conn,'SET NAMES 'utf8''); //データを取得します
$results = mysqli_query($conn,'SELECT id,type,title FROM news');
//Josn string
$ json = '';
//サンプルなのでループは自分で制御できます
$i=0;
while($row = mysqli_fetch_assoc($results))
{
$json .= json_encode($row );
//データテーブルには 3 つのデータしかありません。 3 番目のデータの最後に「,」を追加する必要はありません。最後のデータ
if ($i<3)
{
$json に「,」を追加する必要はないことに注意してください。 = ",";
}
}
//データを配列に詰め込みます
$json = '{"query":[ '.$json.']}';?>
< ;!doctype html public " -//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Json の例< /title> <br> <meta http-equiv="Content-Type" c /> <br><meta http-equiv="Pragma" c /> http-equiv="キャッシュ コントロール" c /> <br></head> <br><script type= "text/javascript"> <br>var json = <?php echo $json?>; <br>alert('+json.query.length + ' オブジェクトがあります。'); <br>alert('type='+ json.query [1]. type+'rntitle'+json.query[1].title); <br>//前の紹介で使用<br></script> <br>Json<br> をデコードします <br>$s_JSON_Decoded = json_decode($json,true); <br>//データを取得します <br>foreach ($s_JSON_Decoded as $row) <br>{ <br>foreach ($row as $rowa) <br>{ <br>echo $rowa ['title ']."<br> "; <br>} <br>} <br>?> <br></body> <br></html> <br>簡単なドリルの後<br> 皆さんは JSON についてより深く理解できたと思います。理解してください<br> もちろん、JSON のアプリケーションはそうではありません例のように簡単です<br>興味がある方は一緒に勉強しましょう <br> 上記は、Everest Ultimate Edition の内容を含む、PHP6 準備クラスの JSON サンプル コードを紹介しています。PHP チュートリアルに興味のある友人に役立つことを願っています。 <br> <br> <br></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>2週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796775427.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/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>2週間前</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>2週間前</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>2週間前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796775427.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/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>2週間前</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>2週間前</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>7411</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>1358</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>19</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</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/1796778251.html" title="Laravelでフラッシュセッションデータを使用します" 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/001/253/068/174177050399455.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravelでフラッシュセッションデータを使用します" /> </a> <a href="https://www.php.cn/ja/faq/1796778251.html" title="Laravelでフラッシュセッションデータを使用します" class="phphistorical_Version2_mids_title">Laravelでフラッシュセッションデータを使用します</a> <span class="Articlelist_txts_time">Mar 12, 2025 pm 05:08 PM</span> <p class="Articlelist_txts_p">Laravelは、直感的なフラッシュメソッドを使用して、一時的なセッションデータの処理を簡素化します。これは、アプリケーション内に簡単なメッセージ、アラート、または通知を表示するのに最適です。 データは、デフォルトで次の要求のためにのみ持続します。 $リクエスト - </p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796779059.html" title="PHPのカール:REST APIでPHPカール拡張機能を使用する方法" 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/67d3a4f0ef568156.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPのカール:REST APIでPHPカール拡張機能を使用する方法" /> </a> <a href="https://www.php.cn/ja/faq/1796779059.html" title="PHPのカール:REST APIでPHPカール拡張機能を使用する方法" class="phphistorical_Version2_mids_title">PHPのカール:REST APIでPHPカール拡張機能を使用する方法</a> <span class="Articlelist_txts_time">Mar 14, 2025 am 11:42 AM</span> <p class="Articlelist_txts_p">PHPクライアントURL(CURL)拡張機能は、開発者にとって強力なツールであり、リモートサーバーやREST APIとのシームレスな対話を可能にします。尊敬されるマルチプロトコルファイル転送ライブラリであるLibcurlを活用することにより、PHP Curlは効率的なexecuを促進します</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796778255.html" title="Laravelテストでの簡略化されたHTTP応答のモッキング" 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/001/253/068/174177056555028.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravelテストでの簡略化されたHTTP応答のモッキング" /> </a> <a href="https://www.php.cn/ja/faq/1796778255.html" title="Laravelテストでの簡略化されたHTTP応答のモッキング" class="phphistorical_Version2_mids_title">Laravelテストでの簡略化されたHTTP応答のモッキング</a> <span class="Articlelist_txts_time">Mar 12, 2025 pm 05:09 PM</span> <p class="Articlelist_txts_p">Laravelは簡潔なHTTP応答シミュレーション構文を提供し、HTTP相互作用テストを簡素化します。このアプローチは、テストシミュレーションをより直感的にしながら、コード冗長性を大幅に削減します。 基本的な実装は、さまざまな応答タイプのショートカットを提供します。 Illuminate \ support \ facades \ httpを使用します。 http :: fake([[ 'google.com' => 'hello world'、 'github.com' => ['foo' => 'bar']、 'forge.laravel.com' =></p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796778636.html" title="Codecanyonで12の最高のPHPチャットスクリプト" 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/001/242/473/174183889317163.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Codecanyonで12の最高のPHPチャットスクリプト" /> </a> <a href="https://www.php.cn/ja/faq/1796778636.html" title="Codecanyonで12の最高のPHPチャットスクリプト" class="phphistorical_Version2_mids_title">Codecanyonで12の最高のPHPチャットスクリプト</a> <span class="Articlelist_txts_time">Mar 13, 2025 pm 12:08 PM</span> <p class="Articlelist_txts_p">顧客の最も差し迫った問題にリアルタイムでインスタントソリューションを提供したいですか? ライブチャットを使用すると、顧客とのリアルタイムな会話を行い、すぐに問題を解決できます。それはあなたがあなたのカスタムにより速いサービスを提供することを可能にします</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796775408.html" title="Laravelサービスプロバイダーを登録および使用する方法" 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/001/242/473/174128149075002.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravelサービスプロバイダーを登録および使用する方法" /> </a> <a href="https://www.php.cn/ja/faq/1796775408.html" title="Laravelサービスプロバイダーを登録および使用する方法" class="phphistorical_Version2_mids_title">Laravelサービスプロバイダーを登録および使用する方法</a> <span class="Articlelist_txts_time">Mar 07, 2025 am 01:18 AM</span> <p class="Articlelist_txts_p">Laravelのサービスコンテナとサービスプロバイダーは、そのアーキテクチャの基本です。 この記事では、サービスコンテナ、詳細サービスプロバイダーの作成、登録、および実用的な使用法を例で説明します。 Oveから始めます</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796782794.html" title="PHPにおける後期静的結合の概念を説明します。" 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/202503/21/2025032113332596253.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPにおける後期静的結合の概念を説明します。" /> </a> <a href="https://www.php.cn/ja/faq/1796782794.html" title="PHPにおける後期静的結合の概念を説明します。" class="phphistorical_Version2_mids_title">PHPにおける後期静的結合の概念を説明します。</a> <span class="Articlelist_txts_time">Mar 21, 2025 pm 01:33 PM</span> <p class="Articlelist_txts_p">記事では、PHP 5.3で導入されたPHPの後期静的結合(LSB)について説明し、より柔軟な継承を求める静的メソッドコールのランタイム解像度を可能にします。 LSBの実用的なアプリケーションと潜在的なパフォーマ</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796776700.html" title="PHPロギング:PHPログ分析のベストプラクティス" 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/67ce86fb248f0637.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPロギング:PHPログ分析のベストプラクティス" /> </a> <a href="https://www.php.cn/ja/faq/1796776700.html" title="PHPロギング:PHPログ分析のベストプラクティス" class="phphistorical_Version2_mids_title">PHPロギング:PHPログ分析のベストプラクティス</a> <span class="Articlelist_txts_time">Mar 10, 2025 pm 02:32 PM</span> <p class="Articlelist_txts_p">PHPロギングは、Webアプリケーションの監視とデバッグ、および重要なイベント、エラー、ランタイムの動作をキャプチャするために不可欠です。システムのパフォーマンスに関する貴重な洞察を提供し、問題の特定に役立ち、より速いトラブルシューティングをサポートします</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796786131.html" title="フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。" 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/202503/28/2025032817124947598.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。" /> </a> <a href="https://www.php.cn/ja/faq/1796786131.html" title="フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。" class="phphistorical_Version2_mids_title">フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。</a> <span class="Articlelist_txts_time">Mar 28, 2025 pm 05:12 PM</span> <p class="Articlelist_txts_p">この記事では、フレームワークにカスタム機能を追加し、アーキテクチャの理解、拡張ポイントの識別、統合とデバッグのベストプラクティスに焦点を当てています。</p> </div> </div> <a href="https://www.php.cn/ja/be/" 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?1744012169"></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>