having some difficulties with arrays

Hi
I want to write a function to get the shortest/longest string lenght from an array. problem is I can’t quite find a way to determine the lenght of elements in order to compare them.I tried using implode() to convert the array to string,but that didn’t really helped me since I didn’t know how to seperate the elements.
so I wrote something like this :

[php] <?php

function f1($input)
{
if(is_array($input))
{
foreach ($input as $value)

?>[/php]

but I’m not sure what’s the next step.

Thanks.

The first thing to do is decide on the algorithm to determine what you want. And you don’t want the array turned into a string, you want the size of each element in the array.

Sponsor our Newsletter | Privacy Policy | Terms of Service