I need to create over 100 directories. Each directory will be named according to a keyword on a list. I figured it would take me all day to do this, so I wrote a PHP script to do this. My attempt has had two unfortunate outcomes.
1) I took all day to write this script when I could have been making the directories
2) The script doesn't work
It creates only one directory which is the last keyword in the file.
So can someone take a look and see what's wrong with the code?
1) I took all day to write this script when I could have been making the directories
2) The script doesn't work
It creates only one directory which is the last keyword in the file.
So can someone take a look and see what's wrong with the code?
PHP:
<?php
$dirs=file('keywords.txt');
$num = count($dirs);
for ($i = 0; $i < $num; $i++)
{
$conn = ftp_connect("ftp.example.net") or die("Could not connect");
ftp_login($conn,"username","pass");
ftp_mkdir($conn,"/public_html/test/uploads/$dirs[$i]");
ftp_close($conn);
}
?>