I am trying to get the maximum value from an array using max finction in php. However despite making sure that the array appears as I expect using print\_r, the max($array) returns the wrong result. 
Please see the code below, I used "simple\_html\_dom.php" from <http://simplehtmldom.sourceforge.net/>. I am expecting a value of 220, but when I echo max($items) it returns 24 when submit is clicked. Any assistance is much appreciated. 

```
<html>

<body>
<h2>Search</h2>
<form method="post">
Search: <input type="text" name="q" value="google"/>
<input type="submit" value="Submit">
</form>

<?php

include 'simple_html_dom.php';  

if (isset($_POST['q'])) {
$search = $_POST['q'];
$search = ucwords($search);
$search = str_replace(' ', '_', $search);  
$html = file_get_html("http://en.wikipedia.org/wiki/$search");

?>
<h2>Search results for '<?php echo $search; ?>'</h2>
<ol>
<?php
$items = array();
foreach ($html->find('img') as $element): ?>

<?php $photo = $element->src;
$logo = 'Logo';
if(strpos($photo, $logo)) 
{

if (preg_match_all('/[0-9]+px/', $photo, $result)) {
echo '<br/>';

$rp = trim($result[0][0],"px") .'<br/>';
$items[] = $rp;

} else {
echo "Not found";
}
} 

?>              

<?php endforeach; echo max($items);
print_r($items);?>
</ol>
<?php 
}
?>

</body>
</html>

```