ホームページ バックエンド開発 PHPチュートリアル PHP_PHP チュートリアルでリモート URL を呼び出す 6 つの方法のまとめ

PHP_PHP チュートリアルでリモート URL を呼び出す 6 つの方法のまとめ

Jul 21, 2016 pm 03:43 PM
file get php url コード による 内部 方法 方法 使用 得る 移行 リモートで

サンプルコード 1: file_get_contents を使用して、取得モードでコンテンツを取得します

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

$url='http://www.baidu.com/ ';
$html= file_get_contents($url);
printhr($http_response_header);


コード例 2: fopen を使用して URL を開き、get メソッドを使用してコンテンツを取得します


コードをコピーします

コードは次のとおりです:
$fp=fopen($url, 'r'); printarr(stream_get_meta_data($fp) ); while(!feof($fp)){
$result.=fgets($fp,1024)
echo" body: $result";
printhr();
fclose ($fp);
?>


サンプルコード 3: file_get_contents 関数を使用して投稿モードで URL を取得します



コードをコピーします

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


$data=array(' foo'=>'bar'); $data=http_build_query($data); $opts=array( 'http' =>array( 'method'=>'POST',
'header '=>"Content-type: application/x-www-form-urlencodedrn".
"Content-Length: ".strlen($データ)."rn",
'content'=>$data
),
$context=stream_context_create($opts);
$html=file_get_contents('http://localhost/e/admin/test) .html',false,$context);
echo$html?>


サンプルコード 4: fsockopen 関数を使用して、ヘッダーと本文を含む完全なデータを取得します



コードをコピーします

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

functionget_url($url,$cookie =false){
$url=parse_url($url);
$query=$url[path]。 "?".$url[クエリ]; ec("クエリ:".$クエリ); $fp= fsockopen($url[ホスト],$url[ポート]?$url[ポート]:80,$errno ,$errstr,30); if(!$fp){ }else{
$request= "GET$queryHTTP/1.1rn"; ;
$request.="接続: 閉じる";
if($cookie)$request.="Cookie: $cookie";
fwrite($fp,$request); (!@feof($fp)){
$result.=@fgets($fp,1024);
fclose($fp);
return$result;
// の HTML 部分を取得します。 URL、ヘッダーを削除
functionGetUrlHTML($url,$cookie=false){
$rowdata=get_url($url,$cookie )
if($rowdata)
{
$body=stristr($rowdata,"rnrn) ");
$body=substr($body,4,strlen($body));
return$body;
}
returnfalse;
}
?>


サンプルコード 5: fsockopen 関数を使用して開きますURL を取得し、POST モードでヘッダーと本文を含む完全なデータを取得します



コードをコピーします

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


<
functionHTTP_Post($URL,$data,$cookie,$referrer? =""){
// 指定された URL を解析します
$URL_Info=parse_url($URL);

// リファラーを構築します
if($referrer==" ")// 指定されていない場合は、このスクリプトをリファラーとして使用します
$referrer="111";

// $data から文字列を作成
foreach($dataas$key=>$value) $values[]=" $key=".urlencode($value); =implode("&",$values); // 必要なポートを調べます - 指定されていない場合は標準 (=80) を使用します if(!isset ($URL_Info["port"])) $URL_Info[ "ポート"]=80;

// POSTリクエスト:
$request.="POST ".$URL_Info["path"]." HTTP/ 1.1n";
$request.="ホスト: "; $URL_Info["host"]."n";
$request.="リファラー:$referern";
$request.="コンテンツ タイプ: application/x-www-form-urlencodedn"; "コンテンツの長さ: ".strlen($data_string)."n";
$request.="接続: 閉じる"
$request.="Cookie: $cookien"; $request.=$data_string."n";

$fp=fsockopen($URL_Info["host"],$URL_Info["port"]); ($fp)){
$result.=fgets($fp,1024);
fclose($fp);
printhr()>


; :curl ライブラリを使用します。curl ライブラリを使用する前に、php.ini をチェックして、curl 拡張機能がオンになっているかどうかを確認する必要がある場合があります



コードをコピーします

コードは次のとおりです。
$ch =curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://www.baidu.com/'); ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents =curl_close($ch);
curl ライブラリについて:
curl 公式 Web サイト http://curl.haxx.se/
curl は、FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE および LDAP をサポートする、URL 構文を使用したファイル転送ツールです。 curl は、SSL 証明書、HTTP POST、HTTP PUT、FTP アップロード、Kerberos、HTTP ベースのアップロード、プロキシ、Cookie、ユーザー + パスワードの証明、ファイル転送の回復、http プロキシ チャネル、その他多くの便利なトリックをサポートしています
コードをコピー コードは次のとおりです:

functionprintarr(array$arr)
{
echo"
行フィールド数: ".count($arr)."
"; foreach($ aras$key=>$value)
{
echo"$key=$value
"
}
}


=========== === ========================================
リモート Web サイトをキャプチャするための PHP コードデータ
多くのプログラミング愛好家が同じ疑問に遭遇するかもしれません。それは、他の人の Web サイトの HTML コードを検索エンジンのようにクロールし、そのコードを収集して自分にとって有用なデータにまとめる方法です。今日の簡単な例

Ⅰ. リモート Web ページのタイトルを取得する例:
以下はコード スニペットです:


コードをコピーします コードは次のとおりです:
/*
+----- -------------------------------------- ------------ ----
+ Web ページのタイトルのコードを取得し、このコード スニペットを直接コピーし、.php ファイルとして保存して実行します。
+---- ------------------------ ---------------------------- ------------
*/

error_reporting(7) ;
$file = fopen ("http://www.jb51.net/", "r"); $file) {
echo "リモート ファイルを開けません。< ;/font>n";
}
while (!feof ($file)) {
$line = fgets ( $file, 1024);
if ("(.*)< ;/title>", $line, $out)) { <br>$title = $out[1]; $title.""; <br>break; <br>} <br>} <br> fclose($file); <br> <br>?> リモート Web ページの HTML コードを取得する例:コード スニペット: <br><br><br><br> コードをコピーします<br><br> コードは次のとおりです: <br> </div> <br><? <br>/* <br>+---------------- <BR>+DNSingスパイダー <div class="codetitle">+---------------- <span style="CURSOR: pointer" onclick="doCopy('code34679')">*/ <U></U>$fp = fsockopen( "www.dnsing.com", 80, $errno, $errstr, 30); (!$fp) { </span>echo "$errstr ($errno)<br/>n"; </div>} else { <div class="codebody" id="code34679"> $out = "GET / HTTP/1.1rn" <BR>$out .= "ホスト:www .dnsing.comrn"; <BR>$out .= "接続: 閉じる rnrn"; <BR>fputs($fp, $out); <BR> while (!feof($fp)) { <BR>echo fgets($fp, 128); <BR> } <br>fclose($fp); <br>//終了 <BR><BR>上記の 2 つのコード スニペットをコピーして実行し、効果を確認してください。上記の例は、Web ページ データをより適切に使用できるようにするための単なるプロトタイプです。したがって、すべてのプログラム愛好家にとって状況は異なります。ここで気をつけて勉強しましょう <br><br>============================== <br><br>もう少し。意味のある関数は次のとおりです。 get_content_by_socket()、Get_url()、get_content_url()、get_content_object は、いくつかのアイデアを提供するいくつかの関数です。 <BR><?php <br><br>//すべてのコンテンツ URL を取得し、ファイルに保存します<BR>function get_index($save_file, $prefix="index_"){ <BR>$count = 68 <BR>$i = 1; $save_file )) @unlink($save_file); <BR>$fp = fopen($save_file, "a+") または die(". $save_file ." を開くことができませんでした"); $url = $i .".htm"; <BR>echo ". $url ."..."; <BR>echo "OKn"; ($ fp, $url_str); <BR>++$i; <BR>} <BR>fclose($fp) <BR>} <BR><BR>// ターゲットのマルチメディア オブジェクトを取得します<BR> function get_object($url_file, $save_file, $split="|- -:* *:--|"){ <BR>if (!file_exists($url_file)) die($url_file ." 存在しません"); <BR>$file_arr = file($url_file); <br>if (!is_array($file_arr) ) || 空($file_arr)) die($url_file ." コンテンツではありません"); <br>$url_arr = array_unique($file_arr); @unlink($save_file); fopen($ save_file, "a+") または die("保存ファイル ". $save_file ." を開くことができませんでした"); <BR>foreach($url_arr as $url){ <BR>if (empty($url)) <BR>echo " Get ". $url ."..."; <BR>$html_str = get_url($url); <BR>echo $html_str; <BR>echo $url; <BR>exit; <BR>$obj_str = get_content_object($html_str); <BR>echo "OKn" ; <BR>fwrite ($fp, $obj_str); <BR>} <BR>fclose($fp) <BR>} <BR><BR>//ファイルの内容を取得する<BR>function get_dir($save_file, $dir){ <BR>$dp = opendir ($dir); <BR> if (file_exists($save_file)) @unlink($save_file); <BR>$fp = fopen($save_file, "a+") または die("保存ファイル ". $save_file ." を開くことができませんでした") ; <BR>while(($ file = readdir($dp)) != false){ <br>if ($file!="." && $file!=".."){ <br>echo "$file を読み取ります。 "..."; <BR>$file_content = file_get_contents($dir . $file); <BR>$obj_str = get_content_object($file_content); <BR>fwrite($fp, $obj_str); fclose($fp); <BR>} <BR><BR><BR>//指定された URL の内容を取得します<BR>function get_url($url){ <BR>$reg = '/^http://[^/].+$/'; if (!preg_match($reg, $ url)) die($url ." 無効"); <BR>$fp = fopen($url, "r") または die("URL を開く: ". $url ." が失敗しました。 "); <BR>while($fc = fread($fp, 8192)){ <BR>$content .= $fc; <BR>} <BR>fclose($fp); <BR>if (empty($content)){ <br>die("Get url: ". $url ." コンテンツが失敗しました。"); <br>} <BR>return $content; <BR>} <BR><BR>//ソケットを使用して指定された Web ページを取得します<BR>function get_content_by_socket($url, $host){ <BR>$fp = fsockopen($host, 80) または die("「. $url ." を開くことができませんでした」); <BR>$header = "GET /".$url ." HTTP/1.1rn"; <BR>$header .= "Accept: * /*rn"; <BR>$header .= "Accept -Language: zh-cnrn"; <BR>$header .= "Accept-Encoding: gzip, deflatern"; <BR>$header .= "User-Agent: Mozilla/4.0 (互換性あり) ; MSIE 6.0; Windows NT SV1; InfoPath.1; <BR>$header .= "ホスト: ".$host ."rn"; <BR>$header : キープアライブン"; <BR>//$header . = "Cookie: cnzz02=2; rtime=1148456424859; cnzz_eid=56601755-rnrn"; <br>$header .= "接続: Closernrn"; <br><BR>fwrite( $fp, $header); <BR>while (!feof ($fp)) { <BR>$contents .= fgets($fp, 8192) <BR>} <BR>fclose($fp); //指定されたコンテンツの URL を取得します <BR>function get_content_url( $host_url, $file_contents){ <BR><BR>//$reg = '/^(#|javascript.*?|ftp://.+|http://. +|.*?href.*?|play.* ?|index.*?|.*?asp)+$/i' <BR>//$reg = '/^(down.*?.html|d+) _d+.htm.*?)$/i'; <BR> $rex = "/([hH][rR][eE][Ff])s*=s*['"]*([^>'"s ]+)["'>]*s*/ i"; <br>$reg = '/^(down.*?.html)$/i'; $result = ""; //array(); <br> foreach($r as $c){ <br>if (is_array($c)){ <br>foreach($c as $d){ <br>if (preg_match($reg, $d)){ $result .= $host_url . $ d."n" } <br>} <br>} <br>} <br>return $result; <br><br>// 指定された content<br> 関数でマルチメディア ファイルを取得します。 str, $split="|--:**:- -|"){ <br>$regx = "/hrefs*=s*['"]*([^>'"s]+)["'> ;]*s*(<b>.*?< ;/b>)/i"; <br>preg_match_all($regx, $str, $result); <br><br>if (count($result) == 3){ <br>$result[2] = str_replace("<b> マルチメディア: ", "", $result[2]); <br>$result[2] = str_replace("</b>", "", $result [2]); <BR>$result[1] [0] .$result[2][0] <BR>} <BR>$result?> ============== =================================== ==== <br><br>同じドメイン名が複数のIPに対応する場合、リモートWebページのコンテンツを取得するPHPの関数<br><br>fgcは単にそれを読み取り、すべての操作をカプセル化します<br>fopenもいくつかのカプセル化を実行しますが、読み込む必要がありますすべてのデータを取得するループ。 <br>fsockopen これは直線のソケット操作です。<br>HTMLページを読むだけならfgcの方が良いです。 <br>会社がファイアウォールを介してインターネットにアクセスする場合、一般的な file_get_content 関数は機能しません。もちろん、いくつかのソケット操作を通じて http リクエストをプロキシに直接書き込むこともできますが、それはより面倒です。 <br>ファイルが小さいことが確認できたら、上記の 2 つのメソッド fopen,join('',file($file)); のいずれかを選択できます。たとえば、1k 未満のファイルのみを操作する場合は、file_get_contents を使用するのが最適です。 <br><br> ファイルが大きいことが確実な場合、またはファイルのサイズを判断できない場合は、ファイル ストリーミングを使用するのが最善です。 1K ファイルを開くことと 1G ファイルを開くことの間に明らかな違いはありません。コンテンツが長ければ長いほど、スクリプトを読み終えるのではなく、読むのに時間がかかります。 <br><br>------------------------------------------------ ---- <br>http://www.phpcake.cn/archives/tag/fsockopen <br>PHP には、file_get_contents や fopen などの独自の関数を使用するなど、リモート Web コンテンツを取得するさまざまな方法があります。 <br><br><?php <br><br>echo file_get_contents("http://img.jb51.net/abc.php"); <br>?><br> ただし、DNSポーリングなどの負荷分散では、同じドメイン名が対応する場合があります。複数 1 つのサーバー、複数の IP。 img.jb51.net は、DNS によって 72.249.146.213、72.249.146.214、および 72.249.146.215 の 3 つの IP に解決されると仮定します。ユーザーが img.jb51.net にアクセスするたびに、システムは、対応する負荷分散アルゴリズム。 <br> 先週、ビデオ プロジェクトに取り組んでいたとき、このような要件に遭遇しました。このサーバーの送信ステータスをクエリするために、各サーバー上の PHP インターフェイス プログラム (abc.php とします) にアクセスする必要がありました。 <br><br> 現時点では、特定のサーバーに繰り返しアクセスし続ける可能性があるため、file_get_contents を使用して http://img.jb51.net/abc.php に直接アクセスすることはできません。 <br><br> そして、これら 3 つのサーバー上で http://72.249.146.213/abc.php、http://72.249.146.214/abc.php、http://72.249.146.215/abc.php に順番にアクセスすると、これもWeb サーバーに複数の仮想ホストが搭載されている場合は使用できません。 <br><br> ホストは同じドメイン名に対応する複数のIPを設定できないため、ローカルホストを設定することはできません。 <br><br> これは、PHP と HTTP プロトコルを通じてのみ実現できます。abc.php にアクセスするときに、ヘッダーに img.jb51.net ドメイン名を追加します。そこで、次の PHP 関数を作成しました: <br><div class="codetitle"> <span style="CURSOR: pointer" onclick="doCopy('code34015')"><u>コードをコピー</u></span> コードは次のとおりです:</div> <div class="codebody" id="code34015"> <br><?php <br><br>/************************* <br>* 機能使用法:同一ドメイン名が複数のIPに対応する場合、指定したサーバーのリモートWebページコンテンツを取得<br>* 作成時刻: 2008-12-09 <br>* 作成者: Zhang Yan (img.jb51.net) <br>* パラメーターの説明: <br>* $ip サーバーの IP アドレス <br>* $host サーバーのホスト名 <br>* $url URL アドレスサーバーの(ドメイン名を除く) <br>* 戻り値: <br>* リモート Web ページのコンテンツを取得しました <br>* false リモート Web ページへのアクセスに失敗しました <br>******************** ***********/ <br>function HttpVisit($ip, $host, $url ) <br>{ <br>$errstr = ''; <br>$fp = fsockopen ($ip, 80, $errstr, 90) <br>{ <br>return false; <br>} <br>else <br>{ <br>$out = "GET {$url} HTTP/1.1rn"; <br>$out .= "ホスト:{$host}rn"; <br>fputs ($fp, $out); <br><br>while($line = fread($fp, 4096)){ <br>$response .= $line; <br>} <br>fclose( $fp )// ヘッダー情報を削除します<br> $pos = strpos($response, "rnrn"); <br>$response = substr($response, $pos + 4); <br><br>return $response; <br>} <br><br>//メソッドの呼び出し: <br>$server_info1 = HttpVisit ("72.249.146.213", "img.jb51.net", "/abc.php"); <br>$server_info2 = HttpVisit("72.249.146.214", "img.jb51.net", "/abc.php") ) ; <br>$server_info3 = HttpVisit("72.249.146.215", "img.jb51.net", "/abc.php"); <br> <br><br><br>http://www.bkjia.com/PHPjc/320696.html<br><br>www.bkjia.com<br><br>tru​​e</div>http://www.bkjia.com/PHPjc/320696.html<p align="left"></p> <div style="display:none;">技術記事<span id="url" itemprop="url"></span>サンプル コード 1: file_get_contents を使用して、次のようにコードをコピーします。 ($http_response_he. ..<span id="indexUrl" itemprop="indexUrl"></span><span id="isOriginal" itemprop="isOriginal"></span> <span id="isBasedOnUrl" itemprop="isBasedOnUrl"></span> </div> </div> </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>2週間前</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>2週間前</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>7467</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>1376</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>77</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>48</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>19</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>20</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/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/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/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/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/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 class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796605003.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/172596043773435.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CakePHP クイックガイド" /> </a> <a href="https://www.php.cn/ja/faq/1796605003.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">CakePHP はオープンソースの MVC フレームワークです。これにより、アプリケーションの開発、展開、保守がはるかに簡単になります。 CakePHP には、最も一般的なタスクの過負荷を軽減するためのライブラリが多数あります。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/1796764479.html" title="PHPでHTML/XMLを解析および処理するにはどうすればよいですか?" 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/246/273/173890063284749.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPでHTML/XMLを解析および処理するにはどうすればよいですか?" /> </a> <a href="https://www.php.cn/ja/faq/1796764479.html" title="PHPでHTML/XMLを解析および処理するにはどうすればよいですか?" class="phphistorical_Version2_mids_title">PHPでHTML/XMLを解析および処理するにはどうすればよいですか?</a> <span class="Articlelist_txts_time">Feb 07, 2025 am 11:57 AM</span> <p class="Articlelist_txts_p">このチュートリアルでは、PHPを使用してXMLドキュメントを効率的に処理する方法を示しています。 XML(拡張可能なマークアップ言語)は、人間の読みやすさとマシン解析の両方に合わせて設計された多用途のテキストベースのマークアップ言語です。一般的にデータストレージに使用されます</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?1744421300"></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>