From: "Stevie D Peele" <[EMAIL PROTECTED]>

> My problem is that I am splicing an array and then echoing the array
> [code]
> <?php
> $input = array("red", "green", "blue", "yellow");
> array_splice($input, 2);
>
> echo $input;
> ?>
> [/code]
>
> and all that is echoed is "Array." I want red green to be echoed.

That's because $input IS an array.

Try just displaying $input[0] and $input[1] for "red" and "green".

You also need to assign the result of array_splice() to something...

$new_array = array_splice($input,2);

Maybe you should explain exactly what you're trying to accomplish with all
of this. There may be a better method.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to