Re: [PHP] Creating a directory
Use mkdir in PHP Functions. See Also: http://www.php.net/manual/en/function.mkdir.php On Fri, 12 Nov 2004 03:54:52 -0500, Danny Brow <[EMAIL PROTECTED]> wrote: > What's the best way to create a directory with PHP, I tried using: > > if (array_exists('dir',$_POST)) { >$dir_name = test123; >shell_exec('mkdir $dir_name'); > > I don't want to have to declare a variable, I would like to do this all > on one line. Like: >shell_exec('mkdir $_POST['dir']'); // but it don't work > } else { >print "Get get some coffee!"; > } > > I'll be putting some error checking in later :) > > Thanks, > Dan. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Efficency in looping arrays?
You mean this? foreach ($arr as $key => $value) { echo "\$arr[${key}] = $value"; } On Wed, 17 Nov 2004 14:05:23 +0100, Peter Lauri <[EMAIL PROTECTED]> wrote: > Hey :) > > But what if the array have a unordered keystructure? What your loop do is > to call the value with key $i, or am I wrong? What if the keys are strings? > > - Best Of Times > /Peter Lauri > > > "Dirk Kredler" <[EMAIL PROTECTED]> skrev i meddelandet > news:[EMAIL PROTECTED] > > > > hey :) > > > > i use for this reason: > > > > for($i= 0, $size= sizeof($arr); $i < $size; $i++) { > > echo $arr[$i]; > > } > > > > Peter Lauri: > > > Best groupmember, > > > > > > For the moment when I loop an array I use something like this: > > > > > > reset($arr); > > > while($a=each($arr)) { > > > echo $a['value']; > > > } > > > > > > But the each() function genereates a array with four elements > (0,1,value, > > > key), I am only interested in the "value". > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require() in other directories?
What error happen? On Thu, 18 Nov 2004 09:15:22 +0100, Peter Lauri <[EMAIL PROTECTED]> wrote: > Best groupmember, > > I have an webapplication that uses different languages and therefor I have > set up different directorys for each language. All languages use the same > classes. > > The problem I have is when I want to require() the classfile I can not > require a file that is not in the same directory as my .php file. I have > tried the following: > > require("../classes.php"); > require("http://www.mydomain.com/classes.php";); > and more. > > All gives me error messages, why? > > Anyone that could help me? > > - Best Of Times > /Peter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php