HEX
Server:Apache
System:Linux localhost 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User:enlugo-es (10006)
PHP:7.4.33
Disabled:opcache_get_status
Upload Files
File: /var/www/vhosts/enlugo.es/httpdocs/wp-content/plugins/landing-pages/shared/functions/shared.php
<?php


/**
 * Get the folder name of the parent directory of the calling file
 * @param $path
 * @return mixed
 */
function inbound_get_parent_directory($path) {
    if (stristr($_SERVER['SERVER_SOFTWARE'], 'Win32')) {
        $array = explode('\\', $path);
        $count = count($array);
        $key = $count - 1;
        $parent = $array[$key];
        return $parent;
    } else if (stristr($_SERVER['SERVER_SOFTWARE'], 'IIS')) {
        $array = explode('\\', $path);
        $count = count($array);
        $key = $count - 1;
        $parent = $array[$key];
        return $parent;
    } else {
        $array = explode('/', $path);
        $count = count($array);
        $key = $count - 1;
        $parent = $array[$key];
        return $parent;
    }
}