Home  >  Article  >  Backend Development  >  2015.1 Knowledge points and functions used when writing message boards ---> Summary

Summary

-->

2015.1 Knowledge points and functions used when writing message boards ---> Summary

WBOY
WBOYOriginal
2016-08-08 09:31:26946browse

1: Time function and uniqid()

 1: uniqid(): Generate a unique id. The length of the returned string without parameters is 13, and with parameters it is 23

 2: PHP function to convert time and timestamp to each other

  ①: time() returns the current unix timestamp microtime() returns the current unix timestamp and microseconds

 ②:date('Y-m-d H:i:s', time()) format a local time/date

 ③:strtotime() Convert the date and time description of the English text of any date into a unix timestamp

2: Jump and redirection of tp framework

 1: Page jump

  ①:success('prompt information', 'jump address', 'jump time'); Default jump address: $_SERVER['HTTP_REFERER'] Default waiting time: 1 second

  ②:error('prompt information', 'jump address', 'jump time'); Default jump address: javascript:history.back(-1) Default waiting time: 3 seconds

 2: Page redirection

  redirect('URL address', 'time', 'prompt information') only wants to redirect a specified url address, not the operation method of a certain module. The usage is consistent with the U function.

 

 

The above introduces the knowledge points and functions used when writing message boards in 2015.1 ---> Summary, including relevant content, I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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