On Sun, 2002-02-03 at 14:06, Lars Torben Wilson wrote:
> On Sun, 2002-02-03 at 12:12, Mike Frazer wrote:
> > Your reply piqued my curiosity so I whipped together a script that times the
> > execution of a foreach(), a while() and a for() loop executing the same
> > commands. The results were rath
On Sun, 2002-02-03 at 12:12, Mike Frazer wrote:
> Your reply piqued my curiosity so I whipped together a script that times the
> execution of a foreach(), a while() and a for() loop executing the same
> commands. The results were rather surprising in some ways but not really
> overall.
>
> The w
Your reply piqued my curiosity so I whipped together a script that times the
execution of a foreach(), a while() and a for() loop executing the same
commands. The results were rather surprising in some ways but not really
overall.
The while() loop is, as you stated, is quicker than a foreach() l
On Sun, 2002-02-03 at 02:35, Mike Frazer wrote:
> A slightly less cumbersome method than the while() loop below would be a
> foreach() loop:
>
> function check_file($filename) {
> if (!$lines = file($filename)) {
> return false;
> }
> foreach ($lines as $line) {
> $n
A slightly less cumbersome method than the while() loop below would be a
foreach() loop:
function check_file($filename) {
if (!$lines = file($filename)) {
return false;
}
foreach ($lines as $line) {
$num_pipes = substr_count($line, '|');
if ($num_pipes < 2 ||
On Fri, 2002-02-01 at 14:02, toni baker wrote:
> I would like to prevent users from uploading a file
> that contains more than 4 pipes or less than 2 pipes.
> The code below prevents users from uploading a file
> containing more than 4 pipes, but not less than 2
> pipes. Should I use awk, ereg, o
I would like to prevent users from uploading a file
that contains more than 4 pipes or less than 2 pipes.
The code below prevents users from uploading a file
containing more than 4 pipes, but not less than 2
pipes. Should I use awk, ereg, or sed? Thanks
system ("/bin/cat $userfile|/bin/sed -n
7 matches
Mail list logo