Here is a simple way to cast all elements in array to integeres in php

$array = array('1', '24', 'da','fa24');
$array = array_map('intval', $array);
And yes it have overhead but for small arrays it is ideal solution instead of writing a classical foreach loop
$array = array('1', '24', 'da','fa24');
foreach($array as $k =>$v) {
	$array[$k] = (int)$v;
}