Jump to content

variables, semicolons, and brackets


Asday

Recommended Posts

Well, I would advise against putting all that on one line as it is not easy to read and undersand what is going on. It might be when you are writing it, but for an outsider or yourself going through it at a later date it may be more difficult.

 

The problem, I believe, is that you are using a for loop instead of a foreach loop. A for loop takes three parameters separated by a semicolon. You are dealing with an array, so you want a foreach loop. Try this:

 

foreach(scandir("upld194") as $x)

Well, I would advise against putting all that on one line as it is not easy to read and undersand what is going on. It might be when you are writing it, but for an outsider or yourself going through it at a later date it may be more difficult.

 

The problem, I believe, is that you are using a for loop instead of a foreach loop. A for loop takes three parameters separated by a semicolon. You are dealing with an array, so you want a foreach loop. Try this:

 

foreach(scandir("upld194") as $x)

 

That was the problem, thanks.

 

It all werks now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.