|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-07 19:42 UTC] iliaa@php.net
[2003-02-20 08:09 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
$tmp = "xx/yy"; $parts = explode("/",$tmp); for($i=0;$i<count($parts);$i++) { $directory = 'files'; //my base-dir //strange loop to show the error for($j=0;$j<=$i;$j++) $directory = $directory . '/' . $parts[$j]; echo 'before :: ' . $directory . '<br>'; @mkdir($directory,0775); echo 'after :: ' . $directory . '<br>'; } outputs: before :: files/xx after :: files/xx before :: files/xx/yy after :: files/xxyy The last line has the error. As you can see mkdir() changes the variable. Even if the rest of the code is buggy ( ;) ) this shouldn't happen :) - bram