小弟我这样的ID如何转换
求助:我这样的ID怎么转换
我这这样的一组ID字符串
10
1010
10122233
我想转换成 下面的整型数
10 000 000 000
10 100 000 000
10 122 233 000
请问一下,这样的算法,我怎么写一下。
最好是有一个方法。
------解决方案--------------------
str_pad
------解决方案--------------------
$s = '10122233';
$s = str_pad($s, 11, '0');
$t = number_format($s);
echo join(' ', explode(',', $t));
------解决方案--------------------
- PHP code
$str1='10';$str2='1010';$str3='10122233';//10 000 000 000//10 100 000 000//10 122 233 000echo str_pad($str1, 11,'0').'<br>';echo str_pad($str2, 11,'0').'<br>';echo str_pad($str3, 11,'0').'<br>';<br><font color="#e78608">------解决方案--------------------</font><br>str_pad(string,length,pad_string,pad_type)//str_pad() 函数把字符串填充为指定的长度。<div class="clear"> </div>

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

AI Hentai Generator
Generate AI Hentai for free.

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

The commentator painted a scenario where dormant XRP wallets could unlock holdings worth tens of millions of dollars.

With crypto enthusiasts looking for profitable opportunities beyond the Bitcoin price, WallitlQ (WLTQ) is quickly becoming a hot ticket for a potential rally.

According to one TikTok user with an interest in old and valuable coins, a 1954 penny has achieved an estimated value of £90,000 - and could fetch in excess of £100,000

In an X post on November 1, Bennet shared an analysis of the BTC market, proclaiming the dip below $70,000 as a concerning development.

With the U.S. presidential election underway, the cryptocurrency market is expected to experience heightened volatility, with short-term price movements likely influenced by the election's outcome.

Bitcoin displays massive strength and barges above the local highs, displaying a huge possibility of forming a new ATH anytime from now

A gold coin exchangeable for a life-changing S$500,000 in cash has been hidden on Oct. 30, the 21st day of the month-long game, and is waiting to be found.

Bitcoin hit a new all-time high just above $77,000 late Friday night, capping off a remarkable week in which Trump regained the White House
