- print_r: documentation ( source)
<?php
$arr = ['this','is', 1, 'array', 'for', 1, 'example'];
$str = array();
$int = array();
foreach($arr as $k => $val) {
if(gettype($arr[$k]) == 'string'){
$str[] = $arr[$k];
} else {
$int[] = $arr[$k];
}
}
print_r($str);
print_r($int);