网址缩短与还原base62
function enbase62($number,$encode = ''){ $base62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; while($number > 0){ $mod = bcmod($number, 62); $encode .= $base62[$mod]; $number = bcp(bcsub($number, $mod), 62); } return strrev($encode); } function debase62($encode, $number = 0){ $base62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $length = strlen($encode); $baselist = array_flip(str_split($base62)); for($i = 0; $i < $length; $i++){ $number = bcadd($number, bcmul($baselist[$encode[$i]], bcpow(62, $length - $i - 1))); } return $number; }
2. [SQL]代码
CREATE TABLE `waoo_shorturl` ( `short_id` int(12) NOT NULL AUTO_INCREMENT COMMENT '自增id', `short_name` varchar(50) DEFAULT NULL COMMENT '别名', `title` varchar(100) DEFAULT NULL COMMENT '标题', `link` varchar(800) DEFAULT NULL COMMENT '网址链接', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `uid` int(10) DEFAULT NULL COMMENT '拥有者', `status` tinyint(1) DEFAULT '1' COMMENT '1有效, 0封禁 -1删除', `top_domain` varchar(100) DEFAULT NULL COMMENT '顶级域名', `all_domain` varchar(100) NOT NULL COMMENT '域名全文', `create_ip` varchar(15) NOT NULL COMMENT 'ip', PRIMARY KEY (`short_id`), UNIQUE KEY `short_name` (`short_name`) ) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8
3.[C/C++]代码
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteRule /d/(?!index)(.*) /d/index/?short_id=$1 [L,NC] RewriteRule /s/(?!index)(.*) /s/index/?short_name=$1 [L,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
以上就是网址缩短与还原base62的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











If you want to check some relevant information in Steam or share some website links with friends, how do you do it? Can I enter a URL into steam? Of course it is possible. Below I will teach you how to open a URL in Steam. Specific methods: 1. First, we open steam. 2. Click the Settings option. 3. Then switch to the interface tab. 4. Check Show address bar. 5. Then enter the URL in the address bar to use the browser.

PHP URL detection refers to using the PHP programming language to verify whether the input string conforms to the format of the URL. Methods to detect URLs: 1. Use regular expressions for URL verification. You can use the "preg_match" function to perform regular matching, if the URL matches the pattern; 2. Use built-in functions for URL verification, use the "filter_var" function and "FILTER_VALIDATE_URL" ” filter to verify.

Teach you how to use PHP to remove the suffix of the URL path. In website development, you often encounter the need to remove the suffix of the URL path to achieve a more beautiful and standardized URL. Today we will learn how to use PHP to remove the suffix of the URL path, let us explore this issue together. First, we need to clarify what effect we want to achieve. Usually, the URL path suffix refers to the file extension in the URL, such as .php, .html, etc. Our goal is to automatically go to the URL when the user accesses the URL with the suffix

New users download and win blind boxes up to 60,000 yuan. The official website of OK Exchange is a website with one of the largest accounts among virtual currency exchanges. Its rich trading modes and multiple digital asset types allow you to enjoy different trading experiences. If you need it, you can click on the OK exchange URL at the top of the page to enter and download. AndroidOKX6.4.0 has been released to the official website (update time: 2023.3.4) Trading: – Commission aggregation of all order types – K-line buying and selling points 2nd period – Contract DCA – Copying Square online search function Web3: – Import wallet list to increase address display – gasPrice multiple adjustment – Gas gas station supports Tron chain – Farm increases Pool income Fin

Where can I download genuine Microsoft win10 image system iso? Nowadays, win10 system software has gradually become a popular operating system, and many users will choose this system software. So next, the editor will tell you about the website where you can download the win10 image system. What is there? What is the win10 image download website? 1. Go to Microsoft Windows 10 official download tool page, enter the query to download the tool and click to download. Website: https://www.microsoft.com/zhcn/softwaredownload/windows10. 2. Start downloading the excellent Windows 10 download tool. If you only want to download the system image, then

Setting method: 1. First open the browser and enter "192.168.0.1, 192.168.1.1"; 2. Enter the password and username account behind the router; 3. After logging in to the setting interface, you can follow the wizard steps; 4. , then you can set the Internet access method, there are three methods available; 5. Select pppoe Internet access and you need to fill in the account password to operate; 6. Perform wireless settings according to needs; 7. Wait for success.

How to replace the link address in PHP: 1. Obtain the current script URL through the "function GetCurUrl(){...}" method; 2. Obtain the current script URL through the "function url_set_value($url,$key,$value) {...}" Just use the method to implement link replacement.

Tutorial on how to use the u master U disk boot disk creation tool 1. Insert the U disk into the computer, open the downloaded u master U disk startup disk creation tool: www.uzhuangji.net, select the U disk 2. Directly click one-click to create the U disk according to the default mode 3. A prompt message will appear. Making a U disk boot disk will clear all data on the U disk and back up the U disk data. Click OK. 4. Then wait for the U disk to be formatted. 5. After waiting, the U disk boot disk production will appear. Tips for completion
