note 75453 added to function.pathinfo
| From: | phpnet at whoisgregg dot com | Date: | Wed, 30 May 2007 18:01:52 +0000 |
| Subject: | note 75453 added to function.pathinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127038@lists.php.net to get a copy of this message | ||
If you want to easily assign the values returned by pathinfo to separate variable names, list
isn't enough. You can use array_values() first to convert the associative array into the
indexed array that list() expects:
// throws notices, variables aren't set
list( $dirname, $basename, $extension, $filename ) = pathinfo($file);
// works
list( $dirname, $basename, $extension, $filename ) = array_values( pathinfo($file) );
----
Server IP: 69.39.81.135
Probable Submitter: 66.15.175.80
----
Manual Page -- http://www.php.net/manual/en/function.pathinfo.php
Edit -- https://master.php.net/note/edit/75453
Del: integrated -- https://master.php.net/note/delete/75453/integrated
Del: useless -- https://master.php.net/note/delete/75453/useless
Del: bad code -- https://master.php.net/note/delete/75453/bad+code
Del: spam -- https://master.php.net/note/delete/75453/spam
Del: non-english -- https://master.php.net/note/delete/75453/non-english
Del: in docs -- https://master.php.net/note/delete/75453/in+docs
Del: other reasons-- https://master.php.net/note/delete/75453
Reject -- https://master.php.net/note/reject/75453
Search -- https://master.php.net/manage/user-notes.php