I wrote one code in php where i wanted to replacing this element with one of its siblings.but in this line
I have facing problem in array_search,means how to use array_search so my function will work proper.below is my function please correct it as soon as possible.
//store old parent
//get own index in parents contents array
if ( $replaceWith->parent==$this->parent)
//We're replacing this element with one of its siblings
if ($index && $index < $myIndex)
//Furthermore, it comes before this element. That
// means that when we extract it, the index of this
//element will change
You appear to have trouble understanding basic PHP syntax. You cannot just call an "array_search" method like that, it's a global function and must be called as such. Also in PHP, functions are entirely different to object methods so there is no $this available and certainly no properties or methods on $this.
thanks mr. salathe..ya it's true i am facing problem to use php syntax .that the region I am doing a basic mistake..so please help me to understand it..and tell me how to replace "this" (nothing but current element) element with one of its siblings
once again thanks for guiding me.