List Info

Thread: note 70815 added to function.pathinfo




note 70815 added to function.pathinfo
user name
2006-10-29 20:19:52
if the file you're trying to get an extension from has
variables attached to it like this one:

jhonson.gif?xxx=1

use this to get the extension without the variables:

// Creating a new file name using the file code:
   $path_parts = pathinfo($file_name);
//Lowering all extensions to low caps!
   $extension = strtolower($path_parts['extension']);
// if file has variables removing them from extension:
   if (!(strpos($extension, "?") === false)) {
      $extension =  substr($extension,0, strpos($extension,
"?"));
   }
----
Server IP: 192.117.122.43
Probable Submitter: 87.69.6.235
----
Manual Page -- ht
tp://www.php.net/manual/en/function.pathinfo.php
Edit        -- https://master
.php.net/note/edit/70815
Del: integrated  -- h
ttps://master.php.net/note/delete/70815/integrated
Del: useless     -- http
s://master.php.net/note/delete/70815/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/70815/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/70815/spam
Del: non-english -- 
https://master.php.net/note/delete/70815/non-english
Del: in docs     -- http
s://master.php.net/note/delete/70815/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/70815
Reject      -- https://mast
er.php.net/note/reject/70815
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

note 70815 deleted from function.pathinfo by nlopess
user name
2006-10-29 20:29:34
Note Submitter: tzveeka at tzveeka dot com 

----

if the file you're trying to get an extension from has
variables attached to it like this one:

jhonson.gif?xxx=1

use this to get the extension without the variables:

// Creating a new file name using the file code:
   $path_parts = pathinfo($file_name);
//Lowering all extensions to low caps!
   $extension = strtolower($path_parts['extension']);
// if file has variables removing them from extension:
   if (!(strpos($extension, "?") === false)) {
      $extension =  substr($extension,0, strpos($extension,
"?"));
   }

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )