Welcome to collectivesolver - Programming & Software Q&A with code examples. A website you can trust. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il


Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Dental Dog Chews
FRESH BREATHIES

GlucoTrust is a brand new, science-backed supplement that supports healthy blood sugar levels AND weight loss for men and women

Everything you need to sell anywhere

Managed VPS Hosting
Affordable. Secure. Your Own Virtual Private Hosting. Faster than AWS and Rackspace

Bonsai Boy of New York Bonsai Trees and Accessories
100%

Disclosure We are a professional Programming & Software Q&A website, that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

25,584 questions

33,347 answers

573 users

How to convert int array to int number in PHP

2 Answers

0 votes
$arr = array(4, 6, 3, 9, 1, 2);
        
$n = 0;

for ($i = 0; $i < count($arr); $i++) {
    $n = $n * 10 + $arr[$i];
}

echo $n;




/*
run:

463912

*/

 




answered 4 days ago by avibootz
0 votes
$arr = array(4, 6, 3, 9, 1, 2);
        
$n = (int)implode("", $arr);

echo $n;




/*
run:

463912

*/

 




answered 4 days ago by avibootz
...