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

2015.1写留言板的时用的 知识点和函数,2015.1留言板

WBOY
Release: 2016-06-13 09:17:15
Original
765 people have browsed it

2015.1写留言板的时用的 知识点和函数,2015.1留言板

一:时间函数和uniqid()

  1:uniqid():生成唯一的id, 无参数返回的字符串的长度为13,有参数为23

  2:时间和时间戳相互转换的php函数

    ①:time()  返回当前unix的时间戳   microtime() 返回当前unix时间戳和微秒数

    ②:date('Y-m-d H:i:s', time()) 格式化一个本地时间/日期

    ③:strtotime()  将任何日期的英文文本的日期时间描述转化为unix时间戳

二:tp框架的跳转和重定向

  1:页面跳转

    ①:success('提示信息', '跳转地址', '跳转时间');   默认的跳转地址: $_SERVER['HTTP_REFERER']     默认的等待时间:1秒

    ②:error('提示信息', '跳转地址', '跳转时间');  默认的跳转地址:  javascript:history.back(-1)  默认的等待时间:3秒

 

  2:页面的重定向

    redirect('URL地址','时间','提示信息') 仅仅想重定向一个指定的url地址,而不是某个模块的操作方法。  和U函数的用法一致。

    

  

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!