php将一个整数拆成一个个个位数,然后再如图安放

WBOY
Release: 2016-06-13 12:27:20
Original
1000 people have browsed it

php将一个整数拆成一个个个位数,然后再如图放置

数字是用php从后台提取的,就是不知道如何把这个数字拆开,好像只有先转为字符串形式。
------解决思路----------------------

$t = str_split(123456);<br />print_r($t);
Copy after login
Array<br />(<br />    [0] => 1<br />    [1] => 2<br />    [2] => 3<br />    [3] => 4<br />    [4] => 5<br />    [5] => 6<br />)<br /><br />
Copy after login

------解决思路----------------------
$num = 12345678;<br />$res = number_format($num);<br />echo $res;
Copy after login

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!