On Tue, January 23, 2007 12:03 am, jekillen wrote:
> Hello php developers:
> I am having a problem with the following code:
> OS: FreeBSD v6.0
> Apache 1.3.34
> php 5.1.2
> -> $cont is an array produced from opening and reading a
> directory:
> for($i = 0; $i < count($cont); $i++)
> {
>
On Jan 22, 2007, at 11:18 PM, clive wrote:
everything without an extension is a directory
You will notice that the only directory detected
by this code is templates. There are no files
detected by this code. Does this have something
to do with stat cache? I want to make one array
with directo
# [EMAIL PROTECTED] / 2007-01-23 09:14:15 +:
> readdir() returns only a basename, you need to be in
> the directory you're traversing (opendir(".") or
> opendir($dir); chdir($dir))
... or prefix the basenames with the path you used in the
opendir() call.
--
How many Vietnam vets does it take
# [EMAIL PROTECTED] / 2007-01-22 23:26:06 -0800:
> On Jan 22, 2007, at 10:20 PM, Chris wrote:
> >$basedir = '/whatever';
> >
> >for($i = 0; $i < count($cont); $i++) {
> > $fullpath = $basedir . '/' . $cont[$i];
> > if (is_file($fullpath)) {
> > .
> >}
>
> Ok, I hope I can get this to work.
try using this, from php manual, clive
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Jan 22, 2007, at 10:20 PM, Chris wrote:
jekillen wrote:
Hello php developers:
I am having a problem with the following code:
OS: FreeBSD v6.0
Apache 1.3.34
php 5.1.2
-> $cont is an array produced from opening and reading a
directory:
for($i = 0; $i < count($cont); $i++)
{
print
everything without an extension is a directory
You will notice that the only directory detected
by this code is templates. There are no files
detected by this code. Does this have something
to do with stat cache? I want to make one array
with directories and one array with files. I can't
see any
Haven't really looked at it - but elseif is one word - or do you mean
else then an if...
Respectfully,
Ligaya Turmelle
-Original Message-
From: jekillen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 23, 2007 4:03 PM
To: PHP General List
Subject: [PHP] having trouble with is
jekillen wrote:
Hello php developers:
I am having a problem with the following code:
OS: FreeBSD v6.0
Apache 1.3.34
php 5.1.2
-> $cont is an array produced from opening and reading a
directory:
for($i = 0; $i < count($cont); $i++)
{
print $cont[$i].'';
if(is_file($cont[$i]))
Hello php developers:
I am having a problem with the following code:
OS: FreeBSD v6.0
Apache 1.3.34
php 5.1.2
-> $cont is an array produced from opening and reading a
directory:
for($i = 0; $i < count($cont); $i++)
{
print $cont[$i].'';
if(is_file($cont[$i]))
{
10 matches
Mail list logo