Home > php教程 > php手册 > body text

PHP Cookbook读书笔记 – 第08章web基础

WBOY
Release: 2016-06-06 19:40:45
Original
1520 people have browsed it

本章主要介绍了和web相关的一些 基础 知识如cookie、get请求、post请求、环境变量的读写等内容。 setcookie() : 设置cookie值 $_COOKIE['名']:获得cookie值 浏览器重定向:header('Location: http://www.example.com/confirm.html'); get_browser() : 获得

PHP Cookbook读书笔记 – 第08章web基础本章主要介绍了和web相关的一些基础知识如cookie、get请求、post请求、环境变量的读写等内容。

setcookie() : 设置cookie值

$_COOKIE['名']:获得cookie值

浏览器重定向:header('Location: http://www.example.com/confirm.html');

get_browser() : 获得浏览器参数
http_build_query() : 将数组转换成查询字符串

$vars = array('name' => 'Oscar the Grouch',
              'color' => 'green',
              'favorite_punctuation' => '#');
$query_string = http_build_query($vars);
$url = '/muppet/select.php?' . $query_string;

结果是:/muppet/select.php?name=Oscar+the+Grouch&color=green&favorite_punctuation=%23
Copy after login

php://input:由来获取post过来的原始数据,用的应该比较少

$_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']:HTTP验证,几乎用不上

flush() : 将当前为止程序的所有输出发送到用户的浏览器

ob_start() : 打开输出缓冲,所有输出将不会立刻发送

ob_end_flush() : 关闭输出缓冲,并将所有输出发送到用户浏览器

getenv() : 得到环境变量

putenv() : 设置环境变量

http://www.cnblogs.com/Excellent

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!