I'm wondering why this is.

$data = "";
$array = explode(",",$data);
$count = count($array);
$count will = 1

$data = "Test";
$array = explode(",",$data);
$count = count($array);
$count will = 1

$data = "Test,Test";
$array = explode(",",$data);
$count = count($array);
$count will = 2

Why doesn't the first one give me an answer of 0 instead of 1. I know I could do a IF $data == "[empty]" and then not count if its empty and just set it to 0, but am wondering if there was a better way.


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326


Reply via email to