PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
NewfieBilko
Forum Contributor
Posts: 189 Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:
Post
by NewfieBilko » Fri Aug 20, 2004 8:43 am
Hey guys, simple request for code here. Just need logic that will check to see if a file is in a directory.
So something like
If "./include/thisfile.php exists = true"
then{
load this}
Else{
Load this}
EndIf
lol im sorry, i just love pseudo code
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri Aug 20, 2004 8:45 am
[php_man]is_file[/php_man]
NewfieBilko
Forum Contributor
Posts: 189 Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:
Post
by NewfieBilko » Fri Aug 20, 2004 8:50 am
thx bro
NewfieBilko
Forum Contributor
Posts: 189 Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:
Post
by NewfieBilko » Fri Aug 20, 2004 8:56 am
Hey bro, you know a way that you can:
Include AllFiles In A Specific Directory?
instead of going
include_once("./lang/$lang/error.php");
include_once("./lang/$lang/another.php");
include_once("./lang/$lang/anoteher.php");
I just wanna go
Loop While Not -1 /$langdir/
{
include_once(file1)
}
lol
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri Aug 20, 2004 8:58 am
Loop through all of the files in the directory and insert each in an include. Be sure to check for '.' and '..' All the code to do this is in this forum.
NewfieBilko
Forum Contributor
Posts: 189 Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:
Post
by NewfieBilko » Fri Aug 20, 2004 9:03 am
How can I pick up what files are in the directory? is_file doesn't do that, is_file checks to see if the designated file is there. How can i get a dirtectory list?
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri Aug 20, 2004 9:13 am