note 126511 added to function.image-type-to-extension
| From: | ergunadem5508 at gmail dot com | Date: | Fri, 15 Oct 2021 19:02:32 +0000 |
| Subject: | note 126511 added to function.image-type-to-extension | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217081@lists.php.net to get a copy of this message | ||
// if you just want to find the format from the file path name without creating any images
// image path name
$image_name = "image name.png";
// After the last point is naturally the format.
$dots = explode(".",$image_name);
// We assign the last data of $dots to the variable $type.
$type = $dots[(count($dots)-1)];
// The output will be written without a dot.
echo "without dot : ".$type;
//for dotted
$type = ".".$type;
echo "dotted : ".$type;
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 31.206.25.38)
----
Manual Page -- https://php.net/manual/en/function.image-type-to-extension.php
Edit -- https://main.php.net/note/edit/126511
Del: integrated -- https://main.php.net/note/delete/126511/integrated
Del: useless -- https://main.php.net/note/delete/126511/useless
Del: bad code -- https://main.php.net/note/delete/126511/bad+code
Del: spam -- https://main.php.net/note/delete/126511/spam
Del: non-english -- https://main.php.net/note/delete/126511/non-english
Del: in docs -- https://main.php.net/note/delete/126511/in+docs
Del: other reasons-- https://main.php.net/note/delete/126511
Reject -- https://main.php.net/note/reject/126511
Search -- https://main.php.net/manage/user-notes.php