2009-05-15, 10:20 PM
hi all
another small php query
i store in a field in one of my databases
then fetch the field and explode it
array formed
then using a small loop remove one of the values
then implode the array and put it back into the database
SAY 4($array[1]) WAS REMOVED ABOVE
its stored as
note the extra comma and space because now the array becomes
another small php query
i store in a field in one of my databases
1,4,2,3,6
then fetch the field and explode it
$fetch = $db->fetch_field($somequery, myfield)
$array = explode(",", $fetch)
array formed
$array[0] = 1
$array[1] = 4
$array[2] = 2
$array[3] = 3
$array[4] = 6
then using a small loop remove one of the values
then implode the array and put it back into the database
SAY 4($array[1]) WAS REMOVED ABOVE
its stored as
1,,2,3,6
note the extra comma and space because now the array becomes
$array[0] = 1
$array[1] = <==BLANK
$array[2] = 2
$array[3] = 3
$array[4] = 6
how can i change it to $array[0] = 1
$array[1] = 2
$array[2] = 3
$array[3] = 6