harunB10 harunB10 - 7 months ago 23
PHP Question

How to create integer out of array?

Is it possible to convert array values into one single integer. For example, I have array with numbers

$array = array(7,4,7,2);

Is it possible to get integer value 7472 from this array?


Simple use implode as

$array = array(7,4,7,2);
echo (int)implode("",$array);// 7472