search
HomeBackend DevelopmentPHP Tutorial小弟我这样的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>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Bitcoin (BTC) Price Predicted to Hit $200,000 by 2025 Based on Historical DataBitcoin (BTC) Price Predicted to Hit $200,000 by 2025 Based on Historical DataJul 31, 2024 pm 12:23 PM

The Bitcoin price has been expected to hit the 6-figure mark for a couple of years now, but this target continues to be elusive for the cryptocurrency.

Shiba Inu (SHIB) Price Prediction: Can SHIB Repeat Its 27000000% Rally of 2021?Shiba Inu (SHIB) Price Prediction: Can SHIB Repeat Its 27000000% Rally of 2021?Jul 30, 2024 am 12:13 AM

In 2021, Shiba Inu (SHIB) emerged as one of the best-performing cryptocurrencies, demonstrating an extraordinary performance during the bull run.

'Rarest' coin in Australia sells for jaw-dropping $106,000'Rarest' coin in Australia sells for jaw-dropping $106,000Jul 30, 2024 pm 12:34 PM

The Royal Australian Mint produced five of these one-kilogram coins back in 2016 to celebrate the Rio Olympics.

Python内建类型str源码分析Python内建类型str源码分析May 09, 2023 pm 02:16 PM

1Unicode计算机存储的基本单位是字节,由8个比特位组成。由于英文只由26个字母加若干符号组成,因此英文字符可以直接用字节来保存。但是其他语言(例如中日韩等),由于字符众多,不得不使用多个字节来进行编码。随着计算机技术的传播,非拉丁文字符编码技术不断发展,但是仍然存在两个比较大的局限性:不支持多语言:一种语言的编码方案不能用于另外一种语言没有统一标准:例如中文就有GBK、GB2312、GB18030等多种编码标准由于编码方式不统一,开发人员就需要在不同编码之间来回转换,不可避免地会出现很多错

Bitcoin (BTC) Market Shakes Off Mt. Gox Fears, Analyst: Expect Bitcoin To Range Between $75,000 And $95,000Bitcoin (BTC) Market Shakes Off Mt. Gox Fears, Analyst: Expect Bitcoin To Range Between $75,000 And $95,000Jul 27, 2024 pm 03:42 PM

After concerns early this week, Bitcoin has rebounded sharply at spot rates. At the time of writing, the world's most valuable coin is up 20% from

This 50-cent Coin Could Be Worth $7,000 — Check Your Change for These 3 Key FeaturesThis 50-cent Coin Could Be Worth $7,000 — Check Your Change for These 3 Key FeaturesAug 07, 2024 am 03:56 AM

Rarity, condition, design, historical significance, and minting errors all contribute to the value of a coin.

Python中__str__和__repr__有什么异同点Python中__str__和__repr__有什么异同点Apr 29, 2023 pm 07:58 PM

__str__和__repr__有什么异同?字符串的表示形式我们都知道,Python的内置函数repr()能够把对象用字符串的形式表达出来,方便我们辨认。这就是“字符串表示形式”。repr()就是通过__repr__这个特殊方法来得到一个对象的字符串表示形式的。如果没有实现__repr__,当我们在控制台里打印一个向量的实例时,得到的字符串可能会是。>>>classExample:pass>>>print(str(Example()))>>>

These £2 coins could make you rich -  check your change nowThese £2 coins could make you rich - check your change nowAug 02, 2024 pm 12:26 PM

Do you want to get rich fast? Well according to one TikTok user, all you need is a series of rare coins in your pocket.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor