Jump to content

Help with file.


ChrisMartino

Recommended Posts

Hey there,

 

Thanks for taking the time to read, I'm a beginner PHP Coder, I would like to know how to create a PHP script that every time you run it, It will create a filename with +1 number each time For example:

 

 

  • 1st Time running the script: Creates directory "/home/servers/server100"
  • 2nd Time running the script: Creates directory "/home/servers/server101"
  • 3rd Time running the script: Creates directory "/home/servers/server102"
  • 4th Time running the script: Creates directory "/home/servers/server103"

 

And it keeps adding +1 to the file name like that each time, How could i do this?, Thats for the help, P.S i would need to execute this VIA SSH2.

 

Link to comment
https://forums.phpfreaks.com/topic/175676-help-with-file/
Share on other sites

pretty much your entire solution will revolve around this function

http://us2.php.net/file_exists

 

you may even possibly find a copy and paste answer in the comments area

 

 

EDIT: If not that function, then this one will be it http://us2.php.net/manual/en/function.is-dir.php

Link to comment
https://forums.phpfreaks.com/topic/175676-help-with-file/#findComment-925771
Share on other sites

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.