php案例 php://output 流

<?php
$output_stream = fopen('php://output', 'w');
fwrite($output_stream, "666<br>\n");
fclose($output_stream);

在这里插入图片描述

解释:

fopen('php://output', 'w') - 打开一个输出流,'w'表示写入模式
fwrite($output_stream, "666<br>\n") - 向输出流写入字符串"666"和HTML换行标签
fclose($output_stream) - 关闭输出流

这段代码的实际效果与直接写echo “666
\n”;完全相同,但使用了更底层的流操作方式。

主要特点:

在设置里更改这个有什么用{ // Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected. // Example: // "Print to console": { // "prefix": "log", // "body": [ // "console.log('$1');", // "$2" // ], // "description": "Log output to console" // } "H1": { "prefix": "/1", "body": ["# $0"] }, "H2": { "prefix": "/2", "body": ["## $0"] }, "H3": { "prefix": "/3", "body": ["### $0"] }, "H4": { "prefix": "/4", "body": ["#### $0"] }, "H5": { "prefix": "/5", "body": ["##### $0"] }, "H6": { "prefix": "/6", "body": ["###### $0"] }, "bold粗体": { "prefix": "/b", "body": ["**$1**$2"] }, "italic斜体": { "prefix": "/i", "body": ["*$1*$2"] }, "underline下划线": { "prefix": "/u", "body": ["<u>$1</u>$2"] }, "line-through删除线": { "prefix": "/x", "body": ["~~$1~~$2"] }, "divider分割线": { "prefix": "/d", "body": ["------", "$1"] }, "link链接": { "prefix": "/k", "body": ["[$2]($1)$3"] }, "image图片": { "prefix": "/img", "body": ["![$2]($1)$3"] }, "inline code行内代码": { "prefix": "/cl", "body": ["`$1`$2"] }, "code block代码片段": { "prefix": "/c", "body": ["```$1", "$0", "```"] }, "ul有序列表": { "prefix": "/ul", "body": ["- $0"] }, "ol无序列表": { "prefix": "/ol", "body": ["1. $0"] }, "task任务列表": { "prefix": "/task", "body": ["- [ ] $0"] }, "quote引用": { "prefix": "/q", "body": ["> $1", "$2"] }, "table表格": { "prefix": "/t", "body": [ "| $1 | $2 | $3 | $4 |", "| ---- | ---- | ---- | ---- |", "| $5 | $6 | $7 | $8 |", "| $9 | $10 | $11 | $12 |", "| $13 | $14 | $15 | $16 |" ] }, "bash代码片段": { "prefix": "/bash", "body": ["```bash", "$0", "```"] }, "html代码片段": { "prefix": "/html", "body": ["```html", "$0", "```"] }, "js代码片段": { "prefix": "/js", "body": ["```js", "$0", "```"] }, "css代码片段": { "prefix": "/css", "body": ["```css", "$0", "```"] }, "vue代码片段": { "prefix": "/vue", "body": ["```vue", "$0", "```"] }, "java代码片段": { "prefix": "/java", "body": ["```java", "$0", "```"] }, "python代码片段": { "prefix": "/python", "body": ["```python", "$0", "```"] }, "ruby代码片段": { "prefix": "/ruby", "body": ["```ruby", "$0", "```"] }, "swift代码片段": { "prefix": "/swift", "body": ["```swift", "$0", "```"] }, "kotlin代码片段": { "prefix": "/kotlin", "body": ["```kotlin", "$0", "```"] }, "c代码片段": { "prefix": "/c", "body": ["```c", "$0", "```"] }, "c++代码片段": { "prefix": "/c++", "body": ["```c++", "$0", "```"] }, "go代码片段": { "prefix": "/go", "body": ["```go", "$0", "```"] }, "php代码片段": { "prefix": "/php", "body": ["```php", "$0", "```"] }, "C#代码片段": { "prefix": "/csharp", "body": ["```csharp", "$0", "```"] }, "scala代码片段": { "prefix": "/scala", "body": ["```scala", "$0", "```"] }, "typescript代码片段": { "prefix": "/typescript", "body": ["```typescript", "$0", "```"] }, "xaml代码片段": { "prefix": "/xaml", "body": ["```xaml", "$0", "```"] }, "模板调用":{ "prefix": "/csharp-template", "body": [ "@[TOC](这里写自定义目录标题)", ">前言 `提示:`", ">开发平台:Win10 64位", "开发环境:VS2022(64位) Preview", ".NET Framework:.NET 6", "例如:。", "---", "[TOC]", "`提示:以下是本篇文章正文内容,下面案例可供参考`", "# 一、章节一", "示例:Redis是一种开源的内存数据结构存储系统,它支持多种数据结构,如字符串、哈希、列表、集合、有序集合等。它可以用作数据库、缓存和消息中间件,并在性能、可扩展性和灵活性方面表现出色。", "![xx picture](./img/xx.png)", "## 1.1 什么是.NET?", "代码如下(示例):", " ```csharp", "```", "# 二、章节二", "## 创建一个表格", "### 一个简单的表格是这么创建的:", "项目 | Value", "-------- | -----", "电脑 | $1600", "手机 | $12", "导管 | $1", "### 设定内容居中、居左、居右的表格", "使用`:---------:`居中", "使用`:----------`居左", "使用`:------------`居右", "| 第一列 | 第二列 | 第三列 |", "|:-----------:| -------------:|:-------------|", "| 第一列文本居中 | 第二列文本居右 | 第三列文本居左 |", "代码如下(示例):", " ```csharp", "```", "该处使用的url网络请求的数据。", "---", "# 三、总结", "提示:这里对文章进行总结:", "例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。", "# 四、参考文献", "- 4.1 ", "- 4.2 " ] } }
12-03
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贵哥的编程之路(热爱分享 为后来者)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值