Php time call problems

Source: Internet
Author: User
Php time call problems do not understand php programming at all, please ask: want to implement, * minutes ago (* hours ago ...), I don't know how to compile it. I found a piece of code on the Internet, which is easy to use and simple: PHPcode & lt ;? Phpfunctionformat_time ($ time) {$ t = time ()-$ time; $ f = array (php time call problem
I don't know much about php programming. please refer:
I want to implement it. I don't know how to compile it. I found a piece of code on the Internet, which is very easy to use. it is also very simple:
PHP code
  
  'Year', '000000' => 'month', '000000' => 'week', '000000' => 'day ', '000000' => 'Hourly ', '60' => 'mine', '1' => 'second'); foreach ($ f as $ k => $ v) {if (0! = $ C = floor ($ t/(int) $ k) {return $ c. $ v. 'pre' ;}} echo format_time ('20140901');?>


However, the time here needs to be converted to the Unix timestamp, and a piece of code is also found:
PHP code
  
  


The page code is as follows:
PHP code
  
  
  ",strtotime($row["pay_time"]))?>
  


Question: How do I integrate the above three codes to implement what I need? * minutes ago (* hours ago?

------ Solution --------------------
PHP code
  'Year', '000000' => 'month', '000000' => 'week', '000000' => 'day ', '000000' => 'Hourly ', '60' => 'mine', '1' => 'second'); foreach ($ f as $ k => $ v) {if (0! = $ C = floor ($ t/(int) $ k) {return $ c. $ v. 'pre' ;}}while ($ row = mysql_fetch_array ($ rs_tmmsm) {echo format_time (strtotime ($ row ["pay_time"]);}?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.