get uuid '315B817C-11F5-718F-F7BD-95E0E95519D0'

@param  boolean $separator if true then contain '-'
@return string
170586
static public function uuid($separator=true)
    {
        if (function_exists('com_create_guid')){
            return com_create_guid();
        }else{
            mt_srand((double)microtime()*10000);    //optional for php 4.2.0 and up.
            $charid = strtoupper(md5(uniqid(mt_rand(), true)));
            $hyphen = $separator ? chr(45) : '';  // "-"
            $uuid = substr($charid, 0, 8).$hyphen
            .substr($charid, 8, 4).$hyphen
            .substr($charid,12, 4).$hyphen
            .substr($charid,16, 4).$hyphen
            .substr($charid,20,12);
            //$uuid = chr(123) . $uuid .chr(125);  // "{" "}"
            return $uuid;
        }
    }
830082
private function tokenize($string, $separator = '')
    {
        if (!strcmp($separator, '')) {
            $separator = $string;
            $string = $this->headerNextToken;
        }

        for ($character = 0; $character < strlen($separator); $character++) {
            if (gettype($position = strpos($string, $separator[$character])) == 'integer') {
                $found = (isset($found) ? min($found, $position) : $position);
            }
        }

        if (isset($found)) {
            $this->headerNextToken = substr($string, $found + 1);

            return substr($string, 0, $found);
        } else {
            $this->headerNextToken = '';

            return $string;
        }
    }
42141
public function join($separator)
    {
        return $this->reduce(
            function ($joined, $string) use ($separator) {
                return ('' === $joined ? '' : $joined . $separator) . $string;
            },
            ''
        );
    }
472402
public static function parseConstantName($constName, $separator='_')
    {
        if (!empty($separator)){
            $pos = strpos($constName, $separator);
            if (false !== $pos && $pos != strlen($constName))
                $constName = substr($constName, $pos+1);
        }
        $constName = str_replace($separator, ' ', $constName);
        return ucwords($constName);
    }
881768
public function convertToCompliantUuid($uuid=false){
        $id = ($uuid?$uuid:$this->uuid);
        $arr = [8, 13, 18, 23];
        foreach ($arr as $part){
            $id = substr_replace($id, '-', $part, 0);
        }
        return $id;
    }
461448
public static function dttm2br($var,$separador="/"){
			if(preg_match('/([0-9]{4})\-([0-9]{2})\-([012][0-9]|3[01])[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})/', $var, $array)){
				$dt = self::checkDtbr($array[3], $array[2], $array[1],$separador);
				if($dt && ($array[4] != '00' || $array[5] != '00'))
					$dt .= '  '.$array[4].':'.$array[5];
				return $dt;
			}
		}
1007308
public function substringAfterLast($separator)
    {
        if (($offset = $this->indexOfLast($separator)) === false) {
            return false;
        }

        return static::create(mb_substr($this->str, $offset + mb_strlen($separator, $this->encoding), null, $this->encoding), $this->encoding);
    }
559995
public function addMacAddressSeparator(string $str, string $separator = ':'): string
    {
        return join($separator, str_split(preg_replace('/[^a-f0-9]/i', '', $str), 2));
    }
1033875
public function getUuid()
    {
        $integers = array_values(unpack('n8', $this->generator->getBytes(16)));

        $integers[3] &= 0x0FFF;
        $integers[4] = $integers[4] & 0x3FFF | 0x8000;

        return vsprintf('%04x%04x-%04x-4%03x-%04x-%04x%04x%04x', $integers);
    }
1099206
public static function getUUID()
    {
        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            // 32 bits for "time_low"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),

            // 16 bits for "time_mid"
            mt_rand(0, 0xffff),

            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 4
            mt_rand(0, 0x0fff) | 0x4000,

            // 16 bits, 8 bits for "clk_seq_hi_res",
            // 8 bits for "clk_seq_low",
            // two most significant bits holds zero and one for variant DCE1.1
            mt_rand(0, 0x3fff) | 0x8000,

            // 48 bits for "node"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
94052
public static function camelCaseToUnderscore(string $camel, string $splitter = '_') : string
    {
        $camel = \preg_replace(
            '/(?!^)[[:upper:]][[:lower:]]/',
            '$0',
            \preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)
        );

        return \strtolower($camel);
    }
92277
private function implode($value, $separator = '|'): string
    {
        if (is_string($value)) {
            return $value;
        }

        if (is_array($value) && count($value) === 1) {
            return reset($value);
        }

        return sprintf('(%s)', collect($value)->implode($separator));
    }
260564
public static function getUUID() : string
    {
        mt_srand((double) microtime() * 10000);
        $charId = strtolower(md5(uniqid(rand(), true)));
        $hyphen = chr(45);
        return substr($charId, 0, 8) . $hyphen . substr($charId, 8, 4) . $hyphen . substr($charId, 12, 4) . $hyphen . substr($charId, 16, 4) . $hyphen . substr($charId, 20, 12);
    }
291539
public static function increment(string $str, int $first = 1, string $separator = '_') : string
    {
        preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match);

        return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
    }
1134477
public static function getStringWithoutLastElement($string, $separator)
    {
        $elements = self::getStringElements($string, $separator);
        $lastKey = Arrays::getLastKey($elements);

        unset($elements[$lastKey]);

        return implode($separator, $elements);
    }
644056
function get($countryCode = false, $separator = '')
    {
        if ($countryCode == false) {
            $formattedNumber = '0' . $this->msisdn;

            if ( ! empty($separator)) {
                $formattedNumber = substr_replace($formattedNumber, $separator, 4, 0);
                $formattedNumber = substr_replace($formattedNumber, $separator, 8, 0);
            }

            return $formattedNumber;
        } else {
            $formattedNumber = $this->countryPrefix . $this->msisdn;

            if ( ! empty($separator)) {
                $formattedNumber = substr_replace($formattedNumber, $separator, strlen($this->countryPrefix), 0);
                $formattedNumber = substr_replace($formattedNumber, $separator, 7, 0);
                $formattedNumber = substr_replace($formattedNumber, $separator, 11, 0);
            }

            return $formattedNumber;
        }
    }
296491
public static function getExtensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
    return self::extensionSignature($namespace, $extensionKey, $separator);
  }