Heads up! This post was written 11 years ago. Some information might be outdated or may have changed since then.
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; 
}

Back to all posts