如何使用PHP session?
在往PHP Session里面保存信息之前,需要首先使用session_start()函数来启动session,
这个函数必须在<html>标签之前调用。代码如下:
<?php session_start(); ?>
<html>
<body>
</body>
</html>
在Session启动以后,可以使用PHP $_SESSION变量来获取和设置session变量,实例代码如下:
<?php
session_start();
// store session data
$_SESSION['views']=1;
?>
如果需要删除一些session数据,你可以使用unset()函数或者session_destroy()函数,
unset()函数用来把某个session变量的值清空,代码如下:
<?php
unset($_SESSION['views']);
?>
还可以调用session_destroy()函数把整个session给销毁, 代码如下:
<?php
session_destroy();
?>
相关文档:
办法一
select * from V$NLS_PARAMETERS
$conn = oci_connect('scott', 'donkey', 'demo', 'zhs16gbk');
while ($dat = oci_fetch_row($cur)) {
print_r(iconv('gb2312', 'utf-8', $dat[0])); //$nickname = mb_convert_encoding($dat[0], 'utf-8', 'gbk');&n ......
php基础学习已经差不多了,但是为检验自己的学习掌握情况,把php基础知识回顾复习了一下
第一个PHP程序
<?php
echo "Hello World!";
?>
1 注释
1.1多行
/*
xxxx
*/
1.2单行
//xxxxx
2. 赋值
$a = 'test';
2.1 检查变量是否已声明
isset($a)
2.2 释放变量
unset($a);
2.3 静 ......
其实这个的主要部分并不是一个jquery,但是必须使用到
php程序部分,也只需要这个一个php程序就可以了
www.corange.cn亲测
<?php
header("Content-Type: text/html; charset=utf-8");
@header( "Cache-Control: no-cache, must-revalidate" );
@header( "Pragma: no-cache" );
@header( "Last-Modified: " ......
1、如何实现字符串翻转?
<?php
function getStr($str){
$len=strlen($str);
for ($i=0;$i<$len/2;$i++){
$temp=$str[$i ......
PHP函数setcookie()用来设置cookie.
setcookie()函数必须在<html>标签之前调用,语法是setcookie (name, value, expire,
path, domain) 例如:
<?php
setcookie(”user”, “Alex
Porter”, time()+3600);
?>
<?php
setcookie(”url”, “http://www.mianwww. ......