Article View: pl.comp.lang.php
Article #220475Re: Rename + open_basedir restriction
From: Ja
Date: Tue, 08 Sep 2009 12:42
Date: Tue, 08 Sep 2009 12:42
23 lines
1511 bytes
1511 bytes
Colin pisze:
> Ja wrote:
>> To w takim razie co zmienić, żeby w pętli zmienić we wszystkich
>> nazwach plików (w jednym katalogu) znaki: %5B na [ , %5D na ] , a $20
>> na spacje?
>
> <?php
> $path = '/home/a68848/public_html/g/';
> $dir = opendir($path);
>
> while (($file = readdir($dir)) !== false)
> {
> if ($file == '.' || $file == '..') continue;
>
> $sciezka = $path.$file;
> $zamiany = array('%5B'=>'[', '%5D'=>']', '%20'=>' ');
> $nowa_sciezka = $path.strtr($file,$zamiany);
>
> if ($sciezka != $nowa_sciezka) rename($sciezka, $nowa_sciezka);
> }
> ?>
Dziękuję!
Technical Details
Message-ID:
<h85jfn$qq5$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mailReferences:
<h85gt8$j3a$1@news.onet.pl> <h85h64$fsp$1@atlantis.news.neostrada.pl> <h85hrv$lel$1@news.onet.pl> <h85iev$8hj$1@mx1.internetia.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mail From: Ja <fm24@poczta.onet.pl> Newsgroups: pl.comp.lang.php Subject: Re: Rename + open_basedir restriction Date: Tue, 08 Sep 2009 14:42:23 +0200 Organization: http://onet.pl Lines: 23 Message-ID: <h85jfn$qq5$1@news.onet.pl> References: <h85gt8$j3a$1@news.onet.pl> <h85h64$fsp$1@atlantis.news.neostrada.pl> <h85hrv$lel$1@news.onet.pl> <h85iev$8hj$1@mx1.internetia.pl> NNTP-Posting-Host: 188.33.33.235 Mime-Version: 1.0 X-Trace: news.onet.pl 1252413751 27461 188.33.33.235 (8 Sep 2009 12:42:31 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Tue, 8 Sep 2009 12:42:31 +0000 (UTC) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <h85iev$8hj$1@mx1.internetia.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit