nasıl kök dizini ayıklamak?

0 Cevap php

Ben hala php öğreniyorum.

'SCRIPT_FILENAME' => string 'D:/Project Storage/wnmp/www/folder/index.php' (length=45)
'SCRIPT_NAME'     => string '/folder/index.php' (length=18)
'DOCUMENT_URI'    => string '/folder/index.php' (length=18)
'PHP_SELF'        => string '/folder/index.php' (length=18)
'REQUEST_URI'     => string '/folder/helloworld/helloworldtwo/etc' (length=15)

Gördüğünüz gibi ben sadece almak istiyorum helloworld/helloworldtwo/etc

herhangi bir fikir extract the folder? öyle olacak helloworld/helloworldtwo/etc?

ne im düşünme gibi benim klasörü tanımlayan im $root = 'folder'. o maç eğer ben bunu ayıklamak, ama sorun ne ile?

the second idea is to get from php_self or anything above to get the first from /first/second.php, but again i dont know the best way to do it.

biz önünde iki klasör gibi olduğunda ve başka bir sorundur? btw replay tümü için teşekkürler im hala bazı okuma php.net, testi, ve deneyin yapıyor.

'SCRIPT_FILENAME' => string 'D:/Project Storage/wnmp/www/folder/index.php' (length=45)
'SCRIPT_NAME'     => string '/folder/folder2/index.php' (length=18)
'DOCUMENT_URI'    => string '/folder/folder2/index.php' (length=18)
'PHP_SELF'        => string '/folder/folder2/index.php' (length=18)
'REQUEST_URI'     => string '/folder/folder2/helloworld/helloworldtwo/etc' (length=15)

soru nasıl i helloworld / hellowrodltwo / etc doğru şekilde alabilirsiniz hala aynı.

edit* guys thanks a lot i have made a solution

$str = 'folder/folder/helloworld/helloworldtwo/etc';
$folder = 'folder/folder';
$q = str_replace($folder, NULL, $str);
echo $q;

ama bir şey / alternatif ya da bunu yapmak için daha iyi bir yolu olup olmadığını lütfen.

Tekrar teşekkürler.

0 Cevap