Scott Miller wrote:
- Original Message -
From: "Oliver Hankeln" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 9:29 AM
Subject: Re: [PHP] Read Last Lines of a Text File
Scott Miller wrote:
I've changed my script to the following:
Scott Miller wrote:
I've changed my script to the following:
$file ="/var/log/radius.log";
$fp = popen("/usr/bin/tail -$limit $file", 'r');
if (! $fp ) {
echo 'unable to pipe command';
}
while (!feof($fp) ) {
$line = fgets($fp);
print $line;
}
?>
And now get the following errors:
Warning: Wrong
Scott Miller wrote:
* Thus wrote Scott Miller ([EMAIL PROTECTED]):
I have a text file (log file) that I want to be able to read the last 30
or
40 lines of. I've created the code below, but since this file is so
large
(currently 8 MB) it won't work. The code works on smaller files, but
not
this on
Phpu wrote:
Hi,
I have this array:
$array = array(element1, element2, element3, element4)
I want to list all elements of this array, so i used:
foreach ($array as $index => $element) {
$InputString = "$element";
echo "$InputString";
}
but this code lists the elements l
Brent Clark wrote:
Hi all
When ever I do echo on my variable I get the following out:
Business%20Class
is there a way to strip the %20, or what ever be displaying if the future.
It looks like this is urlencoded. (%20 = hex 20 = Space) use
echo urldecode($var);
to output it.
Oliver
--
PHP General Ma
Alex Hogan wrote:
When I'm using the time() function am I getting the time on the server?
If not how can I get the time from the server regardless of whether or
not its in the same time zone as the client.
That's quite easy: PHP runs on the server. What time is it you will get?
The server's.
HTH
Ol
Bob Lockie wrote:
I've got this psuedo code that works in the Mozilla browser but does not
work in IE or Opera or Konqueror.
The input type isn't passing a request name or value and I have a few
buttons and I use the name passed to determine with button was pressed.
The PHP related thing
Mozilla
Craig wrote:
Yeah those damn email always come at same time.
Well on my blocked list now.
This is only helping the Symptom. Why not solve the Problem?
The mails you got are auto-replies. Unfortunatley I didn't find a person
responsible for this [EMAIL PROTECTED] but perhaps such a person
is readin
Dave Carrera wrote:
Hi List,
I am trying to list all files in a remote url for processing into my attempt
at a search engine but I cant work out how to list the files found in a
given domain name.
The manual has nothing on this, as I can see, and searching the web has
drawn a blank.
So I ask the li
body
else surfing the site.
Oliver
--
___
walter interactive - Agentur für Neue Medien DRESDEN.BERLIN.MÜNCHEN
Oliver Hankeln -Softwareentwicklung-
Telefon +49 (0) 3 51 / 4 75 52-30 Mobil+49 (0) 1 77 / 3 14 89 45
Telefax +49 (0) 3 51 / 4
Curt Zirzow wrote:
* Thus wrote Oliver Hankeln ([EMAIL PROTECTED]):
10 Searches in a rather small string took
0.38s with strpos() and 0.55s with preg_match()
Make sure your benchmarks aren't bias:
- assignment takes time
- concating string takes time
You are right. I updated the s
Jay Blanchard wrote:
[snip]
Tipp: Do not use preg_match() if you only want to check if one string
is contained in another string. Use strpos() or strstr() instead as they
will be faster.
[/snip]
This brings up a good point. Just exactly how much faster would one be
over another in this small exa
Jay Blanchard wrote:
[snip]
Is it possible to request that a string CONTAINS another string...?
EG:
$string = "1, 2, 3, 7, 8, 9";
if ($string CONTAINS "7") {
// Do stuff
}
[/snip]
Almost any regex function would work here, for instance
$string = "1, 2, 3, 7, 8, 9";
if (preg_match("/7/", $st
[EMAIL PROTECTED] wrote:
Is it possible to request that a string CONTAINS another string...?
EG:
$string = "1, 2, 3, 7, 8, 9";
if ($string CONTAINS "7") {
// Do stuff
}
int strpos ( string haystack, string needle [, int offset])
is what you are looking for.
HTH,
O
[EMAIL PROTECTED] wrote:
How about just using cron to call wget, and wget the URL of your page?
It depends.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e1+$price2);
or
$str=sprintf("$%1.2f",$price1+$price2);
HTH,
Oliver Hankeln
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
mysql support (see
http://coopunit.forestry.uga.edu:8080/test.php) You do however have dbx
support. You might want to look at http://de.php.net/manual/de/ref.dbx.php
Your mysql_connect has to be replaced by dbx_connect and so on...
Alternativly you could recompile php with mysql support.
HTH,
Oliver
; I need to find a way to download the file itself, the rest is - as I
said before - fairly simple (attaching the file to a mail will be
handled by the Mail class).
>
> Anyway, thanks for your time!
>
If the remote file has a URL eg. http://foo.com/bar.pdf you can simply
open it using fopen()
Hi!
I get memory exceded errors and want to find out why. So I am looking
for a way to determine how much memory is currently beeing used by my
script. Is this possible?
getPID + reading from /proc dosent work because php is an apache module.
(I can´t change this)
Thanks!
--
PHP General Maili
19 matches
Mail list logo