Home Backend Development PHP Tutorial 小弟我这样的ID如何转换

小弟我这样的ID如何转换

Jun 13, 2016 am 10:34 AM
000 echo str

求助:我这样的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>
Copy after login
Statement of this Website
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

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

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

XRP Community Commentator Offers Compelling View of XRP's Potential Future Value XRP Community Commentator Offers Compelling View of XRP's Potential Future Value Nov 06, 2024 pm 06:42 PM

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

WallitlQ (WLTQ) Ethereum Token Set For 300X Rally Driven By Revolutionary Crypto Wallet Capabilities WallitlQ (WLTQ) Ethereum Token Set For 300X Rally Driven By Revolutionary Crypto Wallet Capabilities Nov 11, 2024 pm 04:08 PM

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

Extremely rare 1954 penny could fetch in excess of £100,000 when it goes under the hammer this month Extremely rare 1954 penny could fetch in excess of £100,000 when it goes under the hammer this month Nov 08, 2024 am 09:08 AM

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

Bitcoin Breaches Crucial $69,000 Support Zone, Pro-Trader Justin Bennett Issues New Cautionary Insight Bitcoin Breaches Crucial $69,000 Support Zone, Pro-Trader Justin Bennett Issues New Cautionary Insight Nov 04, 2024 am 07:30 AM

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.

Bitcoin (BTC) Price Could Reach a New Peak Approximately One Year After the Upcoming U.S. Election Bitcoin (BTC) Price Could Reach a New Peak Approximately One Year After the Upcoming U.S. Election Nov 05, 2024 pm 09:32 PM

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.

Top Altcoins to Watch When the Bitcoin Price Forms a New ATH at $80,000 Top Altcoins to Watch When the Bitcoin Price Forms a New ATH at $80,000 Oct 30, 2024 am 03:32 AM

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

Hunt The Mouse cash hunt game raises the stakes with S$500,000 gold coin drop Hunt The Mouse cash hunt game raises the stakes with S$500,000 gold coin drop Oct 30, 2024 pm 10:20 PM

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 (BTC) Hit a New All-Time High of $77K, ETF Products Amass $1.36B in Daily Inflows Bitcoin (BTC) Hit a New All-Time High of $77K, ETF Products Amass $1.36B in Daily Inflows Nov 09, 2024 am 10:26 AM

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

See all articles