Counting comma seperated values in php,how to?

Posted by Jay on Stack Overflow See other posts from Stack Overflow or by Jay
Published on 2010-03-16T22:04:56Z Indexed on 2010/03/16 22:11 UTC
Read the original article Hit count: 179

Filed under:
|
|

Hey folks,

I have a variable holding values separated by a comma (Implode), I'm trying to get the total count of the values in that variable however, count() is just returning 1.

I've tried converting the comma separated values to a properly formatted array which still spits out1.

So heres the quick snippet where the sarray session equals to value1,value2,value3:

$schools = $_SESSION['sarray'];
$result = count($schools);

Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about count