私の.htaccessファイルは次のようなものです:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
そして私のindex.php:
echo '<pre>';
print_r(explode('/', $_SERVER['REQUEST_URI']));
echo '</pre>';
に行くとexample.com/test/one/two、次のように返されます。
Array
(
[0] =>
[1] => test
[2] => one
[3] => two
)
なぜ0があるのですか?