HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/slfopp7cb1df/www/pm/app/ThirdParty/nelexa-php-zip/vendor/nelexa/zip/src/Util/StringUtil.php
<?php

namespace PhpZip\Util;

/**
 * String Util.
 *
 * @internal
 */
final class StringUtil
{
    /**
     * @param string $haystack
     * @param string $needle
     *
     * @return bool
     */
    public static function endsWith($haystack, $needle)
    {
        $length = \strlen($needle);

        if ($length === 0) {
            return true;
        }

        return substr($haystack, -$length) === $needle;
    }

    /**
     * @param string $string
     *
     * @return bool
     */
    public static function isBinary($string)
    {
        return strpos($string, "\0") !== false;
    }

    /**
     * @param string $name
     *
     * @return bool
     */
    public static function isASCII($name)
    {
        return preg_match('~[^\x20-\x7e]~', (string) $name) === 0;
    }
}