I am using the explode function to chop a string into pieces.
$data = "|1|2|";
$data_arr = explode("|", trim($data));
When I do this the count of the pieces is 4 with the following values.
$data[0] = ""
$data[1] = "1"
$data[2] = "2"
$data[3] = ""
can anyone explain why I get back the front and the back as blank? I don't quite understand why I wouldn't just get back a count of 2.
Thank You