第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

有沒(méi)有人能翻譯一下這段,有點(diǎn)看不懂謝謝謝謝謝謝

<?php

setcookie('test', time());

ob_start();

print_r($_COOKIE);?

$content = ob_get_contents();

$content = str_replace(" ", '&nbsp;', $content);

ob_clean();

header("content-type:text/html; charset=utf-8");

echo '當(dāng)前的Cookie為:<br>';

echo nl2br($content);


正在回答

2 回答

<?php

setcookie('test', time());

//創(chuàng)建名為test的cookie,time()設(shè)置失效時(shí)間

ob_start();

//開始進(jìn)入輸出緩沖區(qū)

print_r($_COOKIE);?

//$_COOKIE變量里面存放所有的cookie,這里的意思是輸出所有的cookie

$content = ob_get_contents();

//得到緩沖區(qū)里面的數(shù)據(jù),存放在$content變量里面

$content = str_replace(" ", '&nbsp;', $content);

//將數(shù)據(jù)里面的空格替換為&nbsp的符號(hào)

ob_clean();

清除緩沖區(qū)

header("content-type:text/html; charset=utf-8");

//聲明文檔類型和編碼格式

echo '當(dāng)前的Cookie為:<br>';

//輸出

echo nl2br($content);

//nl2br() 函數(shù)在字符串中的每個(gè)新行(\n)之前插入 HTML 換行符(<br> 或 <br />)。

6 回復(fù) 有任何疑惑可以回復(fù)我~

1.ob_start?—?Turn on output buffering

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

The contents of this internal buffer may be copied into a string variable using?ob_get_contents(). To output what is stored in the internal buffer, use?ob_end_flush(). Alternatively,?ob_end_clean()?will silently discard the buffer contents.

2.ob_clean?—?Clean (erase) the output buffer

This function discards the contents of the output buffer.

This function does not destroy the output buffer like?ob_end_clean()?does.

The output buffer must be started by?ob_start()?with?PHP_OUTPUT_HANDLER_CLEANABLE?flag. Otherwise?ob_clean()?will not work.

3.ob_get_contents?—?Return the contents of the output buffer

Gets the contents of the output buffer without clearing it.

以上內(nèi)容,是在官方文檔上查閱~~

這段代碼,看上去像是打開緩沖區(qū);讀取cookie,修改;清理緩沖區(qū)。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
PHP進(jìn)階篇
  • 參與學(xué)習(xí)       181905    人
  • 解答問(wèn)題       2646    個(gè)

輕松學(xué)習(xí)PHP中級(jí)課程,進(jìn)行全面了解,用PHP快速開發(fā)網(wǎng)站程序

進(jìn)入課程

有沒(méi)有人能翻譯一下這段,有點(diǎn)看不懂謝謝謝謝謝謝

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)