I'm trying to do a simple text<->array set of functions
something like:
array_to_text($array){}
text_to_array($text){}
what happens...
I've got a string
$string="one,two,three"
I convert that to an array
$array("one","two","three")
I decide to delete "two" so I do unset $array[1]
now instead of:
$array("one","three")
which I assume I should have, I have:
$array("one", NULL, "three")
Is there another way to delete an entry?
Why isn't there just an array_delete/remove function? This has really been a frustrating problem.
I don't want to use serialize because I am trying to output something that is more user-friendly and doesn't add 8 or so characters per entry.
Also, the example listed below (that I copied from the manual) returned nothing when I tried it. So I presume there is an error.
Array Functions
Sort
1
2 $fruits = array ("lemon", "orange", "banana", "apple");
3 sort ($fruits);
4 for (reset ($fruits); $key = key ($fruits); next ($fruits)) {
5 echo "fruits[$key] = ".$fruits[$key]."\n";
6 }
7