Hi everyone!
Well here is my code that displays this:
It works wonderful.
The code is:
Code: function time_elapsed_string($ptime) {
$etime = time() - $ptime;
if ($etime < 1) {
return '0 seconds';
}
$a = array( 12 * 30 * 24 * 60 * 60 => 'year',
30 * 24 * 60 * 60 => 'month',
24 * 60 * 60 => 'day',
60 * 60 => 'hour',
60 => 'minute ago',
1 => 'second'
);
foreach ($a as $secs => $str) {
$d = $etime / $secs;
if ($d >= 1) {
$r = round($d);
return $r . ' ' . $str . ($r > 1 ? 's ago' : '');
}
}
}
But I would like it to say, instead of just 1 Minute ago, make it say "1 Minute 25 Seconds ago"
I would want to add seconds into there on the minutes.
Can somone revamp this and post again the correct way, Thanks for your patience, ( Sorry for my other topic I was too excited) I'm trying to be nice and professional for u.
date function help
i need help with date functionCode: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want to randomly find a user id, and username from a table, and then store each of these names in the
Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don't even know what the proper term for it is:Background info:Animals Table - animalid, name, photo,
help with insert
Hi there,I am trying to insert some data into a database, but for some reason, it is not inserting.Can anyone see anything wrong with my code:<?php$host = "***";$username =
array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I have a .csv file with about 300 records in it. The code worked perfect while testing on 3 or 4
From Header Showing 'Unkown' In Hotmail? Why?
Code: $to = $row_GetID['email_addr'].',sales@mywebaddress.co.uk'; $subject = 'Thank you for your www.mywebaddress Order'.' ('.$row_GetID['ordernum_ID'].')';$headers = 'From:web@mywebaddress.co.uk';if
PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg" id="doLogin3" value="Login">ON FIREFOX it works finebut on
Move array index to end
Hey guys, Quick question: I have an array that looks like this:Code: [Select]$var = array( 'name' => 'thename', 'title' => 'thetitle', 'media'
Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.Code: $moderators = array('Admin', 'banana', 'orange');if (in_array("{$_SESSION['user_name']}", $moderators)) print('Found it!');i
Creating a db with a query
Hello everyone.I'm having troubles creating a db with a query.I'm reading a book called PHP Bibles from Tim Converse I get this errorFatal error: Call to undefined function mysql_create_db() in