php-general Digest 14 Feb 2005 14:27:49 -0000 Issue 3285
Topics (messages 208625 through 208630):
Re: Server Uptime
208625 by: Leif Gregory
Re: Ensure a number is three digits long
208626 by: Burhan Khalid
Re: need help parsing named.conf file
208627 by: Burhan Khalid
Re: Artificial Intelligence for PHP
208628 by: Nadim Attari
Information
208629 by: wez.thebrainroom.com
calling php function when submit button is pressed
208630 by: ross.aztechost.com
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hello Brad,
Monday, February 7, 2005, 3:21:26 PM, you wrote:
BC> What is the function, or how do you make a script that displays
BC> the server's uptime?
If you're on Windows you could do this:
**************
function serverUptime()
{
$uptimeStamp = filemtime('c:/pagefile.sys');
$uptime = time() - $uptimeStamp;
$days = floor($uptime / (24*3600));
$uptime = $uptime - ($days * (24*3600));
$hours = floor($uptime / (3600));
$uptime = $uptime - ($hours * (3600));
$minutes = floor($uptime /(60));
$uptime = $uptime - ($minutes * 60);
$seconds = $uptime;
$theUpTime = $days." days, ".$hours." hours, ".$minutes." minutes and
".$seconds." seconds";
$lastReBoot = date("r", $uptimeStamp);
RETURN $theUpTime;
}
**************
It'll give you an output like this:
21 days, 6 hours, 48 minutes and 49 seconds
Note: I didn't write this code, this is how WinSysInfo does it. It
works very well. He's got a lot of neat code in his beta 2 version for
pulling all sorts of info off Windows systems.
If you're not on a Windows server, *nix might have a file other than
pagefile.sys that you could do the same thing with.
Cheers,
Leif Gregory
--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>
--- End Message ---
--- Begin Message ---
Shaun wrote:
Hi,
I have am trying to create functions to convert strings to ascii and vice
versa:
http://www.php.net/ord
http://www.php.net/chr
--- End Message ---
--- Begin Message ---
Torsten Rosenberger wrote:
Hello
is there a way to parse the named.conf file with preg_match_all to get
back an array which looks like
[options][directory] = '/var/lib/named'
[options][forwoarder] = '192.168.0.2'
[zone][mydomain.com][type] = 'master'
[zone][mydomain.com][notify] = 'yes'
[zone][domain2.com][type] = 'slave'
http://pear.php.net/package/File_DNS
--- End Message ---
--- Begin Message ---
Hello,
These links might help:
http://coding.mu/index.php/archives/category/php/
http://www.phparchitect.com/news/466
http://www.phppatterns.com/index.php/article/articleview/71/1/11/
Regards,
Nadim
"C.F. Scheidecker Antunes" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Hello,
>
> I am interested on Artificial Intelligence for PHP, pattern maching, etc.
> More specifically: data mining, statistics and pattern maching.
>
> Couple of years ago there was a presentation on the MELL Extension - AI
> for PHP.
>
> I've tried to google it but I've found no code or examples.
>
> Does anyone have any knowledge on using PHP for AI systems or know of
> any resource, a book
> or on the internet that might help me out?
>
> Thanks in advance,
>
> C.F.
--- End Message ---
--- Begin Message ---
Important informations!
--- End Message ---
--- Begin Message ---
Can anyone show me how to call a function when submit is pressed or a form
is submitted.
I am for an alternative to $php_self which refreshes the whole page. I want
to run the function which displays the errors on a form and only do a
$php_self when the form is filled out correctly.
thanks
Ross
--- End Message ---