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.
Google Map
I have done Google Map Integration for one my project. But for that we need the "latitude and longitude" for this. How we will find the these values using PHP 5.1.6. In 5.2, we can do it
split values
I have values that are returned to me in this format:name=>test,age=>49What I want to get out of this is an array like thisarray('name'=>'test','age'=>'49');I was hoping
Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in the box, I just want it to say something like "User has no inventory listed" You can see
Help on query replacing the date
Hi Pals,
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a sessionCode: <?phpinclude_once 'Connect.php';if (!is_authed()) { die ('You are not
article site help remaining text
Hi all hope you will be fineI am creating a article site in this site i want to put some text on main page and link it via "read more" text from articles page and complete article will be
is this the proper use of mysql_real_escape_string() to prevent sql injections?
i was wondering is this the proper use of mysql_real_escape_string() to prevent sql injections? any help greatly appreciated. thanks. derekCode:
PDO returns erroneous columns from within pdt
Hi All,This is a truly weird behavior:When using a simple pdo fetch, erroneous columns are returned!Steps to reproduce:------------------------------------------------------------ -----------1.create
Inserting Data into a MS Access DB using PHP.
As part of my uni course I am doing a placement at a company whom want me to create a client zone for their website.Basically, they want me to create the code to get data from a MS Access db and
MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,