reverse a linked list from the middle?

i have done linked list implementation using class in php.
but it is reversing the whole list. please help.

code - PkxK9l - Online PHP Interpreter & Debugging Tool - Ideone.com

@rjohari23
What you exactly want to do.

@arpit728 i figured out the problem. :slight_smile: