note 60369 added to function.basename
| From: | poniestailatgmaildotcom at osu1 dot php dot net | Date: | Thu, 05 Jan 2006 00:18:56 +0000 |
| Subject: | note 60369 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101231@lists.php.net to get a copy of this message | ||
examples from "icewind" and "basname" seem highly overdone... not to mention
example from "basename" is exactly the same as one from "icewind"...
possibly a more logical approach?
<?
//possible URL = http://domain.com/path/to/file.php?var=foo
$filename = substr( $_SERVER["SCRIPT_NAME"], 1 ); //substr( ) used for optional removal
of initial "/"
$query = $_SERVER["QUERY_STRING"];
?>
to see the entire $_SERVER variable try this:
<?
echo "<pre>
".print_r( $_SERVER, true )."
</pre>
";
?>
----
Manual Page -- http://www.php.net/manual/en/function.basename.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60369
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60369&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60369&report=yes
Search -- http://master.php.net/manage/user-notes.php