include/helpers/util.helper.php

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php  if(!defined('DEDEINC')) exit('dedecms');
/**
 * 核心小助手
 *
 * @version        $Id: util.helper.php 4 19:20 2010年7月6日Z tianya $
 * @package        DedeCMS.Helpers
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
 
define('T_NEW_LINE', -1);

if (!function_exists('token_get_all_nl')) 
{
    function token_get_all_nl($source)
    {
        $new_tokens = array();

        // Get the tokens
        $tokens = token_get_all($source);

        // Split newlines into their own tokens
        foreach ($tokens as $token)
        {
            $token_name = is_array($token) ? $token[0] : null;
            $token_data = is_array($token) ? $token[1] : $token;

            // Do not split encapsed strings or multiline comments
            if ($token_name == T_CONSTANT_ENCAPSED_STRING || substr($token_data, 0, 2) == '/*')
            {
                $new_tokens[] = array($token_name, $token_data);
                continue;
            }

            // Split the data up by newlines
            $split_data = preg_split('#(\r\n|\n)#', $token_data, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

            foreach ($split_data as $data)
            {
                if ($data == "\r\n" || $data == "\n")
                {
                    // This is a new line token
                    $new_tokens[] = array(T_NEW_LINE, $data);
                }
                else
                {
                    // Add the token under the original token name
                    $new_tokens[] = is_array($token) ? array($token_name, $data) : $data;
                }
            }
        }

        return $new_tokens;
    }
}
    
if (!function_exists('token_name_nl')) 
{
    function token_name_nl($token)
后面还有 319 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。