{"id":388,"date":"2011-12-08T12:40:47","date_gmt":"2011-12-08T12:40:47","guid":{"rendered":"http:\/\/www.websitedesignwebsitedevelopment.com\/?p=388"},"modified":"2014-03-19T09:14:14","modified_gmt":"2014-03-19T09:14:14","slug":"php-explode-php-end-file-name-file-extension","status":"publish","type":"post","link":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/","title":{"rendered":"PHP Explode, PHP End, File Name, File Extension"},"content":{"rendered":"<h2>PHP Explode, PHP End, File Name, File Extension<\/h2>\n<p><img decoding=\"async\" src=\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\" align=\"right\" \/><br \/>\nif ( ! function_exists(&#8216;file_parts&#8217;))<br \/>\n{<br \/>\nfunction file_parts($url,$params=&#8217;ext&#8217;)<br \/>\n{<\/p>\n<p>if($params==&#8217;ext&#8217;)<br \/>\n{<br \/>\n$parts = explode(&#8216;.&#8217;,$url);<br \/>\nreturn end($parts);<br \/>\n}<br \/>\nelseif($params==&#8217;name&#8217;)<br \/>\n{<br \/>\n$parts = explode(&#8216;\/&#8217;,$url);<br \/>\nreturn end($parts);<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n$parts = explode(&#8216;\/&#8217;,$url);<br \/>\n$file_name_ext = explode(&#8216;.&#8217;,end($parts));<br \/>\n$file_name = array_pop($file_name_ext);<br \/>\nreturn implode(&#8216;.&#8217;,$file_name);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP Explode, PHP End, File Name, File Extension if ( ! function_exists(&#8216;file_parts&#8217;)) { function file_parts($url,$params=&#8217;ext&#8217;) { if($params==&#8217;ext&#8217;) { $parts = explode(&#8216;.&#8217;,$url); return end($parts); } elseif($params==&#8217;name&#8217;) { $parts = explode(&#8216;\/&#8217;,$url); return end($parts); } else { $parts = explode(&#8216;\/&#8217;,$url); $file_name_ext = explode(&#8216;.&#8217;,end($parts)); $file_name = array_pop($file_name_ext); return implode(&#8216;.&#8217;,$file_name); } } }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[35],"tags":[],"class_list":["post-388","post","type-post","status-publish","format-standard","hentry","category-helper-functions"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP Explode, PHP End, File Name, File Extension<\/title>\n<meta name=\"description\" content=\"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Explode, PHP End, File Name, File Extension\" \/>\n<meta property=\"og:description\" content=\"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\" \/>\n<meta property=\"og:site_name\" content=\"AndroidBubble Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-08T12:40:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-19T09:14:14+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\" \/>\n<meta name=\"author\" content=\"Fahad\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fahad\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\"},\"author\":{\"name\":\"Fahad\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"headline\":\"PHP Explode, PHP End, File Name, File Extension\",\"datePublished\":\"2011-12-08T12:40:47+00:00\",\"dateModified\":\"2014-03-19T09:14:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\"},\"wordCount\":66,\"image\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\",\"articleSection\":[\"Helper Functions\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\",\"url\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\",\"name\":\"PHP Explode, PHP End, File Name, File Extension\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\",\"datePublished\":\"2011-12-08T12:40:47+00:00\",\"dateModified\":\"2014-03-19T09:14:14+00:00\",\"author\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"description\":\"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.\",\"breadcrumb\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage\",\"url\":\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\",\"contentUrl\":\"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/androidbubble.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website Development\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PHP Frameworks\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"CodeIgniter\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Helper Functions\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/helper-functions\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"PHP Explode, PHP End, File Name, File Extension\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\",\"url\":\"https:\/\/androidbubble.com\/blog\/\",\"name\":\"AndroidBubble Blog\",\"description\":\"Articles &amp; Posts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/androidbubble.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\",\"name\":\"Fahad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"caption\":\"Fahad\"},\"sameAs\":[\"http:\/\/www.androidbubbles.com\/\",\"https:\/\/x.com\/phpFlex\"],\"url\":\"https:\/\/androidbubble.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP Explode, PHP End, File Name, File Extension","description":"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/","og_locale":"en_US","og_type":"article","og_title":"PHP Explode, PHP End, File Name, File Extension","og_description":"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.","og_url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/","og_site_name":"AndroidBubble Blog","article_publisher":"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453","article_published_time":"2011-12-08T12:40:47+00:00","article_modified_time":"2014-03-19T09:14:14+00:00","og_image":[{"url":"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png","type":"","width":"","height":""}],"author":"Fahad","twitter_misc":{"Written by":"Fahad"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#article","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/"},"author":{"name":"Fahad","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"headline":"PHP Explode, PHP End, File Name, File Extension","datePublished":"2011-12-08T12:40:47+00:00","dateModified":"2014-03-19T09:14:14+00:00","mainEntityOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/"},"wordCount":66,"image":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage"},"thumbnailUrl":"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png","articleSection":["Helper Functions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/","url":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/","name":"PHP Explode, PHP End, File Name, File Extension","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage"},"image":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage"},"thumbnailUrl":"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png","datePublished":"2011-12-08T12:40:47+00:00","dateModified":"2014-03-19T09:14:14+00:00","author":{"@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"description":"PHP Explode, PHP End, File Name, File Extension is a useful function to get the portions from a url.","breadcrumb":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#primaryimage","url":"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png","contentUrl":"http:\/\/www.websitedesignwebsitedevelopment.com\/wp-content\/uploads\/2011\/12\/wdwd_ci.png"},{"@type":"BreadcrumbList","@id":"https:\/\/androidbubble.com\/blog\/website-development\/php-frameworks\/codeigniter\/helper-functions\/php-explode-php-end-file-name-file-extension\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/androidbubble.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Website Development","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/"},{"@type":"ListItem","position":3,"name":"PHP Frameworks","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/"},{"@type":"ListItem","position":4,"name":"CodeIgniter","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/"},{"@type":"ListItem","position":5,"name":"Helper Functions","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/php-frameworks\/codeigniter\/helper-functions\/"},{"@type":"ListItem","position":6,"name":"PHP Explode, PHP End, File Name, File Extension"}]},{"@type":"WebSite","@id":"https:\/\/androidbubble.com\/blog\/#website","url":"https:\/\/androidbubble.com\/blog\/","name":"AndroidBubble Blog","description":"Articles &amp; Posts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/androidbubble.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7","name":"Fahad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","caption":"Fahad"},"sameAs":["http:\/\/www.androidbubbles.com\/","https:\/\/x.com\/phpFlex"],"url":"https:\/\/androidbubble.com\/blog\/author\/admin\/"}]}},"views":768,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/comments?post=388"}],"version-history":[{"count":3,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":1698,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/388\/revisions\/1698"}],"wp:attachment":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/media?parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/categories?post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/tags?post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}