-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
86 lines (81 loc) · 21.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!doctype html>
<html lang="zh"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta><title>Niomaor个人主页</title><link rel="manifest" href="/manifest.json"><meta name="application-name" content="Niomaor个人主页"><meta name="msapplication-TileImage" content="/img/favicon.ico"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Niomaor个人主页"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="description" content="Niomaor的宝藏屋,什么有趣的东西都在这里啦~"><meta property="og:type" content="blog"><meta property="og:title" content="Niomaor个人主页"><meta property="og:url" content="http://www.tplus.eu.org/"><meta property="og:site_name" content="Niomaor个人主页"><meta property="og:description" content="Niomaor的宝藏屋,什么有趣的东西都在这里啦~"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="http://www.tplus.eu.org/img/og_image.png"><meta property="article:author" content="Niomaor"><meta property="twitter:card" content="summary"><meta property="twitter:image:src" content="http://www.tplus.eu.org/img/og_image.png"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.tplus.eu.org"},"headline":"Niomaor个人主页","image":["http://www.tplus.eu.org/img/og_image.png"],"author":{"@type":"Person","name":"Niomaor"},"publisher":{"@type":"Organization","name":"Niomaor个人主页","logo":{"@type":"ImageObject","url":"http://www.tplus.eu.org/img/logo.png"}},"description":"Niomaor的宝藏屋,什么有趣的东西都在这里啦~"}</script><link rel="icon" href="/img/favicon.ico"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css"><link rel="stylesheet" href="https://unpkg.com/[email protected]/styles/atom-one-light.css"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;600&family=Source+Code+Pro"><link rel="stylesheet" href="/css/default.css"><style>body>.footer,body>.navbar,body>.section{opacity:0}</style><!--!--><!--!--><!--!--><!--!--><link rel="stylesheet" href="https://unpkg.com/[email protected]/build/cookieconsent.min.css"><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/lightgallery.min.css"><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/justifiedGallery.min.css"><!--!--><!--!--><style>.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3273dc;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}</style><script src="https://unpkg.com/[email protected]/pace.min.js"></script><!--!--><!--!--><!-- hexo injector head_end start --><script>
(function () {
function switchTab() {
if (!location.hash) {
return;
}
const id = '#' + CSS.escape(location.hash.substring(1));
const $tabMenu = document.querySelector(`.tabs a[href="${id}"]`);
if (!$tabMenu) {
return;
}
const $tabMenuContainer = $tabMenu.parentElement.parentElement;
Array.from($tabMenuContainer.children).forEach($menu => $menu.classList.remove('is-active'));
Array.from($tabMenuContainer.querySelectorAll('a'))
.map($menu => document.getElementById($menu.getAttribute("href").substring(1)))
.forEach($content => $content.classList.add('is-hidden'));
if ($tabMenu) {
$tabMenu.parentElement.classList.add('is-active');
}
const $activeTab = document.querySelector(id);
if ($activeTab) {
$activeTab.classList.remove('is-hidden');
}
}
switchTab();
window.addEventListener('hashchange', switchTab, false);
})();
</script><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.1.1"></head><body class="is-3-column"><nav class="navbar navbar-main"><div class="container navbar-container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/"><img src="/img/logo.png" alt="Niomaor个人主页" height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item is-active" href="/">首页</a><a class="navbar-item" href="/archives">文章</a><a class="navbar-item" href="/about">关于</a><a class="navbar-item" href="/api">免费API</a><a class="navbar-item" href="/game">小游戏</a></div><div class="navbar-end"><a class="navbar-item" target="_blank" rel="noopener" title="主题" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a><a class="navbar-item search" title="搜索" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-6-widescreen"><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2024-01-26T16:00:00.000Z" title="2024-1-27 0:00:00">2024-01-27</time>发表</span><span class="level-item"><time dateTime="2024-03-31T03:51:39.159Z" title="2024-3-31 11:51:39">2024-03-31</time>更新</span><span class="level-item"><a class="link-muted" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="level-item">5 分钟读完 (大约707个字)</span></div></div><p class="title is-3 is-size-4-mobile"><a class="link-muted" href="/3022059df2f2/">PHP新手必学代码片段(三)</a></p><div class="content"><p>今天继续给大家带来 《PHP新手必学代码片段(三)》</p>
<hr>
<h4 id="21-从服务器下载文件并保存"><a href="#21-从服务器下载文件并保存" class="headerlink" title="21.从服务器下载文件并保存"></a>21.从服务器下载文件并保存</h4><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$file_url</span> = <span class="string">"https://www.example.com/example.txt"</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 下载文件内容</span></span><br><span class="line"><span class="variable">$file_content</span> = <span class="title function_ invoke__">file_get_contents</span>(<span class="variable">$file_url</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">// 确定本地文件保存路劲</span></span><br><span class="line"><span class="variable">$local_path</span> = <span class="string">"C:\Users\xxx\Desktop\file.txt"</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 将下载文件内容保存到本地文件中</span></span><br><span class="line"><span class="title function_ invoke__">file_put_contents</span>(<span class="variable">$local_path</span>, <span class="variable">$file_content</span>);</span><br><span class="line"></span><br><span class="line"><span class="keyword">echo</span> <span class="string">"File Downloaded and Saved Successfully!"</span>;</span><br></pre></td></tr></table></figure></div><a class="article-more button is-small is-size-7" href="/3022059df2f2/#more">阅读更多</a></article></div><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2024-01-26T04:00:00.000Z" title="2024-1-26 12:00:00">2024-01-26</time>发表</span><span class="level-item"><time dateTime="2024-03-31T03:51:30.174Z" title="2024-3-31 11:51:30">2024-03-31</time>更新</span><span class="level-item"><a class="link-muted" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="level-item">3 分钟读完 (大约409个字)</span></div></div><p class="title is-3 is-size-4-mobile"><a class="link-muted" href="/7cff71e1ecd9/">PHP新手必学代码片段(二)</a></p><div class="content"><p>今天继续给大家带来 《PHP新手必学代码片段(二)》</p>
<hr>
<h4 id="11-将字符串反转"><a href="#11-将字符串反转" class="headerlink" title="11.将字符串反转"></a>11.将字符串反转</h4><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$str</span> = <span class="string">"Hello World"</span>;</span><br><span class="line"><span class="variable">$reversed_str</span> = <span class="title function_ invoke__">strrev</span>(<span class="variable">$str</span>);</span><br><span class="line"><span class="keyword">echo</span> <span class="variable">$reversed_str</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 输出:dlroW olleH</span></span><br></pre></td></tr></table></figure>
<hr>
<h4 id="12-获取当前时间和日期"><a href="#12-获取当前时间和日期" class="headerlink" title="12.获取当前时间和日期"></a>12.获取当前时间和日期</h4><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$current_time</span> = <span class="title function_ invoke__">date</span>(<span class="string">"Y-m-d H:i:s"</span>);</span><br><span class="line"><span class="keyword">echo</span> <span class="string">"Current time and date: "</span> . <span class="variable">$current_time</span>;</span><br></pre></td></tr></table></figure></div><a class="article-more button is-small is-size-7" href="/7cff71e1ecd9/#more">阅读更多</a></article></div><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2024-01-25T16:00:00.000Z" title="2024-1-26 0:00:00">2024-01-26</time>发表</span><span class="level-item"><time dateTime="2024-03-31T03:41:52.987Z" title="2024-3-31 11:41:52">2024-03-31</time>更新</span><span class="level-item"><a class="link-muted" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="level-item">5 分钟读完 (大约730个字)</span></div></div><p class="title is-3 is-size-4-mobile"><a class="link-muted" href="/534ea3667ad6/">PHP新手必学代码片段(一)</a></p><div class="content"><h4 id="1-输出Hello-World!"><a href="#1-输出Hello-World!" class="headerlink" title="1.输出Hello World!"></a>1.输出Hello World!</h4><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">echo</span> <span class="string">"Hello World!"</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 输出:Hello World</span></span><br></pre></td></tr></table></figure>
<hr>
<h4 id="2-变量声明与使用"><a href="#2-变量声明与使用" class="headerlink" title="2.变量声明与使用"></a>2.变量声明与使用</h4><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$name</span> = <span class="string">"John"</span>;</span><br><span class="line"><span class="keyword">echo</span> <span class="string">"My name is "</span> . <span class="variable">$name</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 输出:My name is John</span></span><br></pre></td></tr></table></figure></div><a class="article-more button is-small is-size-7" href="/534ea3667ad6/#more">阅读更多</a></article></div></div><div class="column column-left is-4-tablet is-4-desktop is-3-widescreen order-1"><div class="card widget" data-type="profile"><div class="card-content"><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div><figure class="image is-128x128 mx-auto mb-2"><img class="avatar is-rounded" src="https://tianxi.pages.dev/hs.jpg" alt="Niomaor"></figure><p class="title is-size-4 is-block" style="line-height:inherit;">Niomaor</p><p class="is-size-6 is-block">万物因爱而生,爱因万物而存</p><p class="is-size-6 is-flex justify-content-center"><i class="fas fa-map-marker-alt mr-1"></i><span>Beautiful China</span></p></div></div></nav><nav class="level is-mobile"><div class="level-item has-text-centered is-marginless"><div><p class="heading">文章</p><a href="/archives"><p class="title">3</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">分类</p><a href="/categories"><p class="title">1</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">标签</p><a href="/tags"><p class="title">1</p></a></div></div></nav><div class="level"><a class="level-item button is-primary is-rounded" href="https://github.com/Niomaor" target="_blank" rel="noopener">关注我</a></div><div class="level is-mobile is-multiline"><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="Github" href="https://github.com/Niomaor"><i class="fab fa-github"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="RSS" href="/"><i class="fas fa-rss"></i></a></div></div></div><div class="card widget" data-type="links"><div class="card-content"><div class="menu"><h3 class="menu-label">链接</h3><ul class="menu-list"><li><a class="level is-mobile" href="https://hexo.io" target="_blank" rel="noopener"><span class="level-left"><span class="level-item">Hexo</span></span><span class="level-right"><span class="level-item tag">hexo.io</span></span></a></li><li><a class="level is-mobile" href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener"><span class="level-left"><span class="level-item">Icarus Theme</span></span><span class="level-right"><span class="level-item tag">github.com</span></span></a></li></ul></div></div></div><div class="card widget" data-type="categories"><div class="card-content"><div class="menu"><h3 class="menu-label">分类</h3><ul class="menu-list"><li><a class="level is-mobile" href="/categories/%E6%95%99%E7%A8%8B/"><span class="level-start"><span class="level-item">教程</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li></ul></div></div></div><!--!--><div class="column-right-shadow is-hidden-widescreen"></div></div><div class="column column-right is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only order-3"><div class="card widget" data-type="recent-posts"><div class="card-content"><h3 class="menu-label">最新文章</h3><article class="media"><div class="media-content"><p class="date"><time dateTime="2024-01-26T16:00:00.000Z">2024-01-27</time></p><p class="title"><a href="/3022059df2f2/">PHP新手必学代码片段(三)</a></p><p class="categories"><a href="/categories/%E6%95%99%E7%A8%8B/">教程</a></p></div></article><article class="media"><div class="media-content"><p class="date"><time dateTime="2024-01-26T04:00:00.000Z">2024-01-26</time></p><p class="title"><a href="/7cff71e1ecd9/">PHP新手必学代码片段(二)</a></p><p class="categories"><a href="/categories/%E6%95%99%E7%A8%8B/">教程</a></p></div></article><article class="media"><div class="media-content"><p class="date"><time dateTime="2024-01-25T16:00:00.000Z">2024-01-26</time></p><p class="title"><a href="/534ea3667ad6/">PHP新手必学代码片段(一)</a></p><p class="categories"><a href="/categories/%E6%95%99%E7%A8%8B/">教程</a></p></div></article></div></div><div class="card widget" data-type="archives"><div class="card-content"><div class="menu"><h3 class="menu-label">归档</h3><ul class="menu-list"><li><a class="level is-mobile" href="/archives/2024/01/"><span class="level-start"><span class="level-item">一月 2024</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li></ul></div></div></div><div class="card widget" data-type="tags"><div class="card-content"><div class="menu"><h3 class="menu-label">标签</h3><div class="field is-grouped is-grouped-multiline"><div class="control"><a class="tags has-addons" href="/tags/PHP/"><span class="tag">PHP</span><span class="tag">3</span></a></div></div></div></div></div></div></div></div></section><footer class="footer"><div class="container"><div class="level"><div class="level-start"><a class="footer-logo is-block mb-2" href="/"><img src="/img/logo.png" alt="Niomaor个人主页" height="28"></a><p class="is-size-7"><span>© 2024 Niomaor</span> Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a></p><p class="is-size-7">Have a Nice Day!</p></div><div class="level-end"><div class="field has-addons"><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="主题" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a></p></div></div></div></div></footer><script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script><script src="https://unpkg.com/[email protected]/min/moment-with-locales.min.js"></script><script src="https://unpkg.com/[email protected]/dist/clipboard.min.js" defer></script><script>moment.locale("zh-cn");</script><script>var IcarusThemeSettings = {
article: {
highlight: {
clipboard: true,
fold: 'unfolded'
}
}
};</script><script src="/js/column.js"></script><script src="/js/animation.js"></script><a id="back-to-top" title="回到顶端" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script src="/js/back_to_top.js" defer></script><!--!--><!--!--><!--!--><script src="https://unpkg.com/[email protected]/build/cookieconsent.min.js" defer></script><script>window.addEventListener("load", () => {
window.cookieconsent.initialise({
type: "info",
theme: "edgeless",
static: false,
position: "bottom-left",
content: {
message: "此网站使用Cookie来改善您的体验。",
dismiss: "知道了!",
allow: "允许使用Cookie",
deny: "拒绝",
link: "了解更多",
policy: "Cookie政策",
href: "https://www.cookiesandyou.com/",
},
palette: {
popup: {
background: "#edeff5",
text: "#838391"
},
button: {
background: "#4b81e8"
},
},
});
});</script><script src="https://unpkg.com/[email protected]/dist/js/lightgallery.min.js" defer></script><script src="https://unpkg.com/[email protected]/dist/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load", () => {
if (typeof $.fn.lightGallery === 'function') {
$('.article').lightGallery({ selector: '.gallery-item' });
}
if (typeof $.fn.justifiedGallery === 'function') {
if ($('.justified-gallery > p > .gallery-item').length) {
$('.justified-gallery > p > .gallery-item').unwrap();
}
$('.justified-gallery').justifiedGallery();
}
});</script><!--!--><!--!--><!--!--><!--!--><!--!--><script src="/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="想要查找什么..."></div><div class="searchbox-pinyin"><label class="checkbox"><input id="search-by-pinyin" type="checkbox" checked="checked"><span> 拼音检索</span></label></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script src="/js/pinyin.js" defer></script><script src="/js/insight.js" defer></script><script>document.addEventListener('DOMContentLoaded', function () {
loadInsight({"contentUrl":"/content.json"}, {"hint":"想要查找什么...","untitled":"(无标题)","posts":"文章","pages":"页面","categories":"分类","tags":"标签"});
});</script></body></html>