{"id":129,"date":"2024-09-28T22:34:21","date_gmt":"2024-09-28T21:34:21","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=129"},"modified":"2024-09-29T06:59:37","modified_gmt":"2024-09-29T05:59:37","slug":"mwnci-basename-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-basename-function\/","title":{"rendered":"Mwnci basename() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>basename(<em>filepath<\/em>)<\/p>\n<h2>Parameters<\/h2>\n<table class=\"confluenceTable tablesorter tablesorter-default\" width=\"464\">\n<tbody>\n<tr class=\"tablesorter-headerRow\">\n<th class=\"confluenceTh sortableHeader tablesorter-headerAsc\" data-column=\"0\">\n<div class=\"tablesorter-header-inner\">Parameter<\/div>\n<\/th>\n<th class=\"confluenceTh sortableHeader\" data-column=\"1\">\n<div class=\"tablesorter-header-inner\">Definition<\/div>\n<\/th>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\"><em>filepath<br \/>\n<\/em><\/td>\n<td class=\"confluenceTd\">Returns the last element of path.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Description<\/h2>\n<p><em>basename()<\/em> returns the last element of path. Trailing path separators are removed before extracting the last element. If the path is empty, Base returns &#8220;.&#8221;. If the path consists entirely of separators, Base returns a single separator.<\/p>\n<h2>Example<\/h2>\n<pre>Dir=getwd()\r\nprintln(Dir)\r\nprintln(basename(Dir))\r\n\r\n\r\n\/home\/afry\/Desktop\r\nDesktop<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax basename(filepath) Parameters Parameter Definition filepath Returns the last element of path. Description basename() returns the last element of path. Trailing path separators are removed before extracting the last element. If the path is empty, Base returns &#8220;.&#8221;. If the path consists entirely of separators, Base returns a single separator. Example Dir=getwd() println(Dir) println(basename(Dir)) \/home\/afry\/Desktop &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-basename-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci basename() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-129","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":3,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/129\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/129\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}