TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   pfp fatal error:cannot redeclare extract() (http://www.talkphp.com/advanced-php-programming/4611-pfp-fatal-error-cannot-redeclare-extract.html)

tech 06-25-2009 12:18 PM

pfp fatal error:cannot redeclare extract()
 
dear all
I am new in php programing and I wrote one function in which I am trying to remove an index from an array using "array_splice".but I don't know i am using in a proper way or not.so please tell me how to remove an index from an array and this fatal error..
I am including my code :
thanks
Code:

<?php
function extract($this)
{
        if($this->parent)
        {
                try
                {   
                array_splice($parent->content,$this);
            }
            catch(Exception $e)
                        {
                                }

        }
        $lastChild=$this->lastRecursiveChild();
        $nextElement =$lastChild->next;

        if($this->previous)
        {
                $this->previous->next=$nextElement;
        }
        if($nextElement)
        {
                $nextElement->previous=$this->previous;
        }
        $this->previous=null;
        $lastChild->next = Null;
        $this->parent = Null;
        if ($this->previousSibling)
        {
                $this->previousSibling->nextSibling = $this->nextSibling;
        }
        if ($this->nextSibling)
        {
                $this->nextSibling->previousSibling = $this->previousSibling;
        }
        $this->previousSibling = $this->nextSibling = Null;
        return $this;
}
?>


Wildhoney 06-25-2009 12:20 PM

Please see this thread: http://www.talkphp.com/absolute-begi...-new-post.html

There is no need to create a new thread, as it's the same code :-)


All times are GMT. The time now is 03:49 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0