Interaction design • webdevelopment • web art • photography
What's wrong with this PHP-script?? | 3.14159, 050515 10:51 |
---|---|
I have now tried to figure out this simple for hours, but I can't find the solutions. The errors are also strange..
I'm running on Apache 2 and PHP 5.0.4. Help! |
|
YYYMKDCCLXXXVII.dsl.saunalahti.fi |
Re: What's wrong with this PHP-script?? | 3.14159, 050515 10:53 |
---|---|
Oh, and it returned the error Parse error: syntax error, unexpected $end in "path" on line 34 |
|
YYYMKDCCLXXXVII.dsl.saunalahti.fi |
Re: What's wrong with this PHP-script?? | Milo, 050515 11:09 |
---|---|
Haven't tested it, but try replacing the single backslash in the implode function call with a double backslash.
|
|
milov.demon.nl |
Re: What's wrong with this PHP-script?? | Mark, 050531 20:57 |
---|---|
If this script is going to run on a *nix machine, why don't use the command 'du'?
|
|
melian.xs4all.nl |
Re: What's wrong with this PHP-script?? | absolut, 050611 01:22 |
---|---|
<? function dirsize($dir) { $list = scandir($dir); $num = count($list); $size=0; foreach ($list as $directory) { $fullfilename=$dir."\".$directory; if (!preg_match("/^\./",$directory)) { if (is_dir($fullfilename)) { $size += (float)dirsize($fullfilename); } else { $size += (float)@filesize($fullfilename); } } } return $size; } $dir = "e:\movies"; $size = dirsize($dir); print $size; ?> |
|
ppp83-237-45-58.pppoe.mtu-net.ru |
Re: What's wrong with this PHP-script?? | absolut, 050611 01:23 |
---|---|
The (float) is needed to break 2Gb limits.
|
|
ppp83-237-45-58.pppoe.mtu-net.ru |
Pages: 1 |
---|