|
Posted by Sonnich on 03/23/07 14:06
On Mar 23, 3:45 pm, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
> Sonnich wrote:
> > Hi
>
> > if I have an array of [a, b, d] and want to insert c, what is the way
> > then?
>
> > Sonnich
>
> $testArr = array('a','b','d');
> // one of the 1000 ways to manipulate an array in PHP:
> $testArr[] = 'c';
> // [] without a number or string means just add at the end
>
> // results in an array 'a','b','d','c'
>
> If you want to sort it, use sort() or usort() if you need anything fancy.
>
> Regards,
> Erwin Moller
I am inserting but cannot sort it, as I have 3 arrays linked together,
and the codes are not as ligical as here.
IT is a tree (like e.g. of folders) with another array with e.g.
properties or anything.
Therefore I use the array_search which tells where something is, then
after that I want to insert something.
/S
[Back to original message]
|